• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set margins between components  RSS feed

 
Raghavan Chockalingam
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to leave space between components, not really wanted to separate them by borders.

1. Margins to separated panels
2. Commonly separating controls like Label, TextArea, Buttons, etc., within a panel

I could not find any method from documentation, can anyone help me with that?
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. With GridLayout you've got hgap and vgap:

public GridLayout(int rows, int cols, int hgap, int vgap)

2. With GridBagLayout there is insets

3. What's wrong with borders, especially empty borders?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!