Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

align JLabels and JTextFields vertically in different areas

 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like to have 3 TitledBorders for 3 different areas of my frame.
Each area has its own components - JLabels, JTextField, etc.
How to align JLabels and JTextFields vertically in different areas?
e.g. for the following test program, how to configure label1, label2, label3 so that their right sides all align vertically and
tf1, tf2, tf3 so that their left sides all align vertically?
 
Andrey Kozhanov
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I only could think of using null layout managers and aligning your components manually.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic