File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Layout problem with the gaps

 
Michail Petrov
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i have one rutien problem

i use the GridLayot and i want to set a space betwean the JLabels in the aplication. When i chainge the gaps i only chaige the JTextField space

The oder problem is haw to set the 4 buttons in the right corner i use the FlowLayout i dont know what actualy to do

 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I told you before - read the tutorials, otherwise we'll be spoon-feeding you for the next 10 years.

http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html
 
Rob Camick
Ranch Hand
Posts: 2473
8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you use a GridLayout, each component is the same size. Therefore the gap between the label and the text field appears larger because of the extra whitespace of the label. Change the labels horizontal alignment to RIGHT and you will see what I mean.

If you want a bigger gap betwen the first text field and second label, then create a panel that uses two grids so you can specify a different gap.

haw to set the 4 buttons in the right corner i use the FlowLayout


Read the FlowLayout API. By default components are aligned to the center, but you can change this to be right aligned.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic