Search code examples
javaswingjframejinternalframejdesktoppane

Java Window Event - Maximize. How to hardcode?


I have a JDesktopPane and a JInternalFrame. I'd like the JInternalFrame to automatically maximize after I make it. How can I hardcode the "maximize window" event?


Solution

  • Use JInternalFrame.setMaximum(true) after you create your frame.

    Here is how you can maximize your frame:

    JInternalFrame frame = ...
    frame..setMaximum(true); // Maximize this window to fill up the whole desktop area