How to resize the monitor application?

1

I have an application that opens a JFrame , having at the top a JMenuBar .

Until I call a MenuBar item a JTabbedPane is hidden and as soon as a menu item is chosen, a Tabbed with jPanel is opened.

In this jPanel I have several components such as buttons, textfield, jspinner, jlabel, etc.

It happens that I made the application programming on my pc and, when networking other pcs, it opens not occupying the screen of other monitors, for the sake of resolution and screen sizes. It is worth mentioning that only JPnael does not open the screen size.

How can I solve this in a proportional way? So that no component is out of place. Half what percentage?

    
asked by anonymous 22.03.2017 / 13:03

1 answer

5

To make the application open maximized, simply add the following excerpt before setVisible() :

seuFrame.setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);

And so that JPanel fits JFrame :

seuFrame.setContentPane(seuJPanel);

Remember that if you have multiple panels inside the Frame, you need to create one to be the main one, which will contain all of them.

However, in order for components to conform to the resolution, you need to work with Layout Managers , they are responsible for distributing components within a Container , just choose the one that best suits your need, or merge several together.

    
22.03.2017 / 13:10