Search code examples
javaresizewindowframescreen-size

Change size of window depending on size of the screen,Java


I want to ask something because I have no idea.I have made a program on Java(Netbeans) and I want to check the size of windows.I want to change depending on the size of screen.Have you any idea?Thank you.


Solution

  • for example..

    JFrame frame = new JFrame();
    frame.setSize(Toolkit.getDefaultToolkit().getScreenSize());