I work on a software that runs in monitors of different screen size from laptop screens to TV screens.I would you to know about java swing feature that auto-adjust the component relatively according to screen size
the following code will returns the screen width and height
Toolkit toolkit = Toolkit.getDefaultToolkit ();
Dimension dim = toolkit.getScreenSize();
frame.setSize(dim.width,dim.height);//here frame is your container
You can use ToolKit, but its always better to have have Half the screen Width and Height.
Toolkit t = Toolkit.getDefalutToolKit();
Dimension d = t.getScreenSize();
int h = d.height;
int w = d.width;
myframe.setSize( w/2 , h/2 );
Swing layouts are the thing you are looking for: http://docs.oracle.com/javase/tutorial/uiswing/layout/using.html
There are types of layouts that dynamically rearranges the components according to the application size. You can see options for layout in the link I gave above.
Fill in the components using layout and than make your application run fullscreen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With