As this was the first and most accurate question to my issue, I will add what I found here. I know it is 3 years old but my answer might help someone in the future. My issue was the same as above. When I built the Jframe I used:
frame.setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);
When I clicked the "restore down" button the window was really small and in the top left corner of the screen. I fixed this by calling:
frame.setBounds(100, 100, 450, 300);
After setVisible(true). Here is the code after my editing, the original code was created with Eclipse WindowBuilder. I am just editing it after. Here is the code complete:
public class MainWindow extends JFrame {
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainWindow frame = new MainWindow();
frame.setVisible(true);
frame.setBounds(100, 100, 450, 300);
frame.setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public MainWindow() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);
//setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
}
Basically what is happening (as far as I can determine) after the Jframe becomes visible it is first set to a size of 450x300, then immediately changes the size to maximized. Now when you hit the restore down button it will set it to the 450x300 size. I am currently searching for a way to override the method used to set the window size to the previous size (before hitting max), but I'm not at a point that I need to ask yet.