Reputation: 324
When my projects starts the lower part of the main Jframe goes beneath the taskbar.
how to solve this problem.
Upvotes: 2
Views: 217
Reputation: 324207
Don't use frame.setSize(...);
Instead use:
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
Or if you do manually need to set the size then use:
Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
Insets insets = frame.getInsets();
and then make sure you subtract out the insets.top and inserts.bottom from the height of the screen. Then the size of your frame must be less then that value.
Upvotes: 3