Toolkit tk = Toolkit.getDefaultToolkit();
Dimension dm = tk.getScreenSize();frame.setSize(dm.width,dm.height);