Results 1 to 3 of 3

Thread: Maximize the main window...

  1. #1
    Join Date
    Dec 2005
    Location
    Mexico City
    Posts
    15

    Unhappy 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. #2
    Join Date
    May 2005
    Posts
    394

    Default

    JFrame has a method to set the window maximized

  3. #3
    Join Date
    Jul 2005
    Location
    Austria
    Posts
    105

    Default 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •