• Post Reply Bookmark Topic Watch Topic
  • New Topic

align JLabels and JTextFields vertically in different areas  RSS feed

 
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!