0

In my application I am using one JFrame and multiple jpanels. I make the JFrame fullScreen with setExtendedState() method. In the main jFrame I load jpanels during runtime. When I load jPanel I use jPanel.setBound(0, 0, 1000, 500).

This looks fine in 1024 x 756 size screens. But when screen size changes The jPanels look very small. Is it possible to maintain the ratio of the jPanels including the other components.

I do not like to use JInternalFrame to handle MDI. Because this looks very ugly when the JInternalFrame is maximized.

I am using null layout in the panels.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Pranjal Choladhara
  • 845
  • 2
  • 14
  • 35
  • 1
    Always prefer `percentages` than `px` – Suresh Atta Jul 10 '13 at 14:19
  • 6
    **I am using null layout in the panels** - Why? – chancea Jul 10 '13 at 14:20
  • 5
    Java GUIs might have to work on a number of platforms, on different screen resolutions & using different PLAFs. As such they are not conducive to exact placement of components. To organize the components for a robust GUI, instead use layout managers, or combinations of them, along with layout padding & borders for white space. Another things they handle with great ability, is ***different screen sizes.*** – Andrew Thompson Jul 10 '13 at 14:22

1 Answers1

1

I suggest you to use "GridBagLayout".

Gabriel Câmara
  • 1,249
  • 15
  • 22