DevFaqMainTitle

(Difference between revisions)
(2º.- Change main title at runtime.)
(2º.- Change main title at runtime.)
Line 32: Line 32:
  @Override
  @Override
-
    public void restored() {
+
public void restored() {
-
   // other code goes here...
+
   // some other code may go here...
     WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
     WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
       @Override
       @Override
Line 41: Line 41:
       });
       });
     }
     }
-
   // other code goes here...
+
   // some other code may go here...
  }
  }

Revision as of 14:00, 18 November 2010

By default, the main title shows the branding name plus the build number.

For production deployment, it could be required to only show the branding name.

There are two possible steps to achieve it:

1º.- Remove the build number.

Open this file:

...\branding\modules\org-netbeans-core-windows.jar\org\netbeans\core\windows\view\ui\Bundle.properties

in your project, and remove existing {0} tokens

CTL_MainWindow_Title=AppBrandingName {0}
CTL_MainWindow_Title_No_Project=AppBrandingName {0}

so it will be as:

CTL_MainWindow_Title=AppBrandingName
CTL_MainWindow_Title_No_Project=AppBrandingName

Build number will not show in the application main title.


2º.- Change main title at runtime.

Inside the ModuleInstaller class for the GUI module:

@Override
public void restored() {
  // some other code may go here...
   WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
     @Override
     public void run() {
       mainFrame = (JFrame) WindowManager.getDefault().getMainWindow();
       mainFrame.setTitle("Modified main title");
     });
   }
  // some other code may go here...
}
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo