How to properly size your JFrame window according to the screen
It's important when programming to think that the screen size for each user who is going to use your app is different. So, you have to resize the window according to the screen resolution.The ideal dimension is to set the length and width with 2/3 the current monitor dimension. To retrieve the screen size in java, the java compiler has the getScreenSize() method of the Toolkit class. Here's an example:
//retrieve screen dimension
MonitorSize Dimension = Toolkit.getDefaultToolkit().getScreenSize();
int length = monitorsize.width * 2/3;
int height = monitorsize.height * 2/3;
//set the size of JFrame to 2/3 the screen size
frame.setSize(length, height);