-
Notifications
You must be signed in to change notification settings - Fork 1
DevFaqInitialMainWindowSize
The default initial size of an application based on NetBeans platform is 90% of the whole screen area and the main window is also centered. These defaults can be redefined quite easily:
-
make sure your module has implementation dependency on Core - Windows module, when using NetBeans 6.9 you can use 'weight' attribute instead of implementation dependency.
-
copy file WindowManager.wswmgr from Core - Windows module into the source folder of your own module (you’ll find it in folder core.windows\src\org\netbeans\core\windows\resources\windowmanager)
-
reference the copied file in your module’s XML Layer:
<folder name="Windows2"> <file name="WindowManager.wswmgr" url="WindowManager.wswmgr"/> </folder>
-
now you can specify either size relative to the size of the whole screen area (the main window will be centered then) which will work on any screen resolution:
<main-window> <joined-properties centered-horizontally="true" centered-vertically="true" relative-width="0.5" relative-height="0.5" /> <separated-properties centered-horizontally="true" relative-y="0.1" relative-width="0.8" relative-height="0.08" /> </main-window>
The snippet from windowmanager.wswmgr above makes the default main window size to be half of the whole screen area.
-
or you can specify exact size and location in pixels:
<main-window> <joined-properties x="0" y="0" width="800" height="600" relative-x="0.0" relative-y="0.0" relative-width="0.0" relative-height="0.0" centered-horizontally="false" centered-vertically="false" maximize-if-width-below="0" maximize-if-height-below="0" frame-state="6"/> <separated-properties x="160" y="116" width="1280" height="93" relative-x="0.0" relative-y="0.0" relative-width="0.0" relative-height="0.0" centered-horizontally="false" centered-vertically="false" frame-state="0" /> </main-window>
The snippet from windowmanager.wswmgr above opens the main window in the upper left corner of the screen and makes its size 800x600 pixels.
-
you can safely ignore separated-properties part, those properties were used for SDI mode which is no longer supported.
-
keep the rest of windowmanager.wswmgr as it was
Note: This way you can also define the default main window state - maximized/minimized/restored, see JavaDoc for possible values.
The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.
This page was exported from http://wiki.netbeans.org/DevFaqInitialMainWindowSize , that was last modified by NetBeans user Simpatico on 2010-11-02T01:43:02Z.
NOTE: This document was automatically converted to the AsciiDoc format on 2018-01-26, and needs to be reviewed.
Apache NetBeans is an effort undergoing incubation at The Apache Software Foundation (ASF).
Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
This wiki is an experiment pending Apache NetBeans Community approval.