Thursday, March 20, 2008
Maximize a Frame using Swing
import java.awt.*;
import javax.swing.*;
public class SwingSetBounds{
public static void main(String[] args){
JFrame frame = new JFrame();
Rectangle bounds = new Rectangle(0, 0, 500, 500);
frame.setMaximizedBounds(bounds);
frame.setSize(400, 400);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment