pelagos
pelagos

Reputation: 1059

Netbeans Java application - change title or name of application

When I run my app (in Netbeans) the title of the app (in the top left corner of my OS) is the name of the java class (not the name I want or the name of the project).

If there a way to change this so it is more meaningful? I am sure there should be but I can't seem to find out how..

I can change the title of the window that opens but I want the name in the top left corner to be different (i.e. the programs name).

Hope this is clear?

Thanks

EDIT WITH SCREENSHOT

enter image description here

OK in this pic the app is running in the foreground and Netbenas behind.

You can see the name I want changed is 'photosjFrame' - to something more meaningful for my app like "Photo Databse" etc etc

Hope this makes sense now…

Thanks

UPDATE 2

Here is another screenshot that I hope makes sense…

enter image description here

I have tried:

this.setTitle("Some meaningful title");

and

super("Some meaningful title");

but as you can see from the screen shot they change the title of the window open not of the application name (or whatever it is called)…

Thanks

Upvotes: 1

Views: 3171

Answers (1)

robzillaDev
robzillaDev

Reputation: 91

Although your question is not as clear as it could be, and the screenshot still doesn't really show us what you desire, is it not as simple as calling...:

this.setTitle("Some meaningful title");

from within the jframe code, or...:

yourFrame.setTitle("Some meaningful title");

from wherever else is appropriate...

To change what text is shown in the Mac taskbar (top left), try adding the following lines:

System.setProperty("apple.laf.useScreenMenuBar","true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Some meaningful name"); 
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())

Or, in newer versions of Java I beleive you can either:

  1. Use the -XDock:name functionality
  2. Set CFBundleName in the information property list. See this link:

See https://developer.apple.com/library/mac/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html

Upvotes: 1

Related Questions