What type of behavior are you looking for because there might be other ways to do so, like adding components to your JFrame dynamically or going into full screen mode.