Question: **How to run the program in maximum size in java ,so that it shows the restore button also, without using** 
Toolkit t=Toolkit.getDefaultToolkit(); 
**as it doesn't show RestoreDown Button**

Answer: 
```
frame.pack();
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setVisible(true);

```
```
frame.setExtendedState(JFrame.MAXIMIZED_BOTH)

```

by using this we can make our screen open in maximize size and it also show us the button for resore-down which is not shown when we use lower one

```
Toolkit t=Toolkit.getDefaultToolkit();
        Dimension d=t.getScreenSize();
        frame.setLocation((d.width-900),(d.height-600));

```