I am trying to develop application using swings in netbeans. So I want to resize my application frame to the screen resolution. Kindly help me out in this problem.
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setVisible(true);
// If you want to always keep the frame at this size
frame.setResizable(false);
Here is a very simple example of it, may be a good start for your application :
import javax.swing.JFrame;
public class MyFrame
{
private JFrame frame;
public MyFrame()
{
frame = new JFrame();
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setVisible(true);
frame.setResizable(false);
}
public static void main(String[] args)
{
new MyFrame();
}
}
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