I am working on software that runs on monitors with different screen sizes from laptop screens to TV screens. I would like to know about the java swing function, which automatically adjusts the component relative to the screen size
the following code will return the width and height of the screen
Toolkit toolkit = Toolkit.getDefaultToolkit (); Dimension dim = toolkit.getScreenSize(); frame.setSize(dim.width,dim.height);//here frame is your container
You can use the ToolKit , but its always best to have half the width and height of the screen .
Toolkit t = Toolkit.getDefalutToolKit(); Dimension d = t.getScreenSize(); int h = d.height; int w = d.width; myframe.setSize( w/2 , h/2 );
U-turn layouts are what you are looking for: http://docs.oracle.com/javase/tutorial/uiswing/layout/using.html
There are types of layouts that dynamically rebuild components to fit the size of the application. You can see the layout options in the link I gave above.
Fill the components using the layout, and then run the application in full screen.