I see many questions about how to maximize a JFrame without hiding the task bar, but in my case the question is just the opposite. I'm trying to use all of the screen including the task bar in order to have more room for my application. Why does my app not use the whole screen?
Here is what I do:
frame.setExtendedState(frame.getExtendedState() | frame.MAXIMIZED_BOTH);
frame.setVisible(true);
(I work on Mac OS X 10.7)
Because most apps want to keep the task bar available so user have easy access to other applications, so the behaviour of extend state method is to exclude the task bar from the maximum size.
You can manually set the size.