Announcement Announcement Module
Collapse
No announcement yet.
Maximize the main window... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maximize the main window...

    Hi there!

    I've been struggling trying to maximize the main window every time the app starts.

    I tried to override the onPostStartup and onPreWindowOpen to get a reference to the application window and adjust it's preferred size to the screen size, but it doesn't work.

    Like this:
    Application.instance().getActiveWindow().getContro l().setPreferredSize(Toolkit.getDefaultToolkit().g etScreenSize());


    Any ideas?

  • #2
    JFrame has a method to set the window maximized

    Comment


    • #3
      Use Extended State

      Don't know whether you find a solution, I override onWindowCreated method in my LifecycleAdvisor that extends DefaultApplicationLifecycleAdvisor:


      Code:
          public void onWindowCreated(ApplicationWindow window) {
              super.onWindowCreated(window);
              window.getControl().setExtendedState(JFrame.MAXIMIZED_BOTH);
              myApp = super.getApplication();
          }
      setExtendedState(JFrame.MAXIMIZED_BOTH) is the magic!

      greetings
      markus

      Comment

      Working...
      X