Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resizing Layout with change in Screen Resolution

 
Sandeep Ramachandran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am programming a Swing application. The entire gui of the application is divided into 9 equal sized panels arranged in 3 rows and 3 columns. Now some panels have tabbed panes and some have some buttons (JButtons). Now the screen resolution of my laptop is 1280x800 pixels. I am using layout managers to layout these panels and the objects inside them. I am using borderlayout and flowlayout predominantly. Now under the above mentioned screen layout everything is fine to look. but when I connect my laptop to a projector to show my GUI to others in a conference, the projector has a lower resolution, so the entire layout is mixed up. In particular the tabbed panes and buttons. I have given some lengthy names as heading of the tabbed panes and so instead of displaying linearly ( one after other ), they overlap. The button are of different sizes and are put in a panel with flowlayout. So the buttons in the right most side of the panel disappear under low resolution. What should I do. I dont mind if the names of the buttons and tabbed panes ends with "......", for example - I have a button called "Create/Modify". The button totally disappears under low resolution.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49733
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like something which would sit better in the Swing Forum.

There are methods in the Toolkit class (you have to use the static getDefaultToolkit method first) which supply screen resolution and screen size, which you can use to resize your display. But you will never get a pretty display with FlowLayout. There are lots of layouts, but some people say to look for MigLayout as the best available.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic