• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFormattedTextField - alignment problem here too  RSS feed

 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, instead of using BoxLayout, I'm using the new JFormattedTextField to align pairs of JLabels and JTextField. There is one bad display problem, the vertical misalignment betw JLables and their corresponding JTextFields.
Here is the code longish stub code:

Yes it works, bar the alignment problem.
TIA :-)
 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured it out.
One must have the same setPreferredSize(new Dimension(int x, int y)) depending on how one wants to align the beast.
Takes a bit of fiddling to make it look nice.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!