1

I've started using a Ubuntu desktop in my new workplace and the window manager doesn't manage java applications very well. They are all treated as one application, no icons or names to recognise them by when you alt tab through them.

I thought perhaps it might be possible to improve the situation by giving the processes or at least windows unique names when I start them.

Maybe this can be done with a command line flag?

barrymac
  • 2,750
  • 1
  • 20
  • 32

1 Answers1

2

Assuming you're creating a JFrame as the root window of your GUI, you can pass an argument in the constructor to set the name. You can certainly get that String value from the String[] args argument of your main method.

G_H
  • 11,739
  • 3
  • 38
  • 82
  • +1 see also this [example](http://stackoverflow.com/questions/4443878/redirecting-system-out-to-jtextpane/4444677#4444677) that redirects output to the screen. – trashgod Oct 25 '11 at 17:00
  • Thanks for your help, unfortunately though I don't have the source for some proprietary applications, like intellij for example. – barrymac Oct 26 '11 at 09:32
  • Ah, thought this was about your own applications. What Java runtime do you have installed? Newer versions might integrate better. For example, a Swing app running in Java 1.4 on Windows 7 can dump your UI to basic mode, but 5 and 6 run fine and can look pretty much native with the right look-and-feel. – G_H Oct 26 '11 at 09:47
  • I think Launch4J might be able to wrap compiled jars but I haven't had too much luck or put much time into it as of yet. – barrymac Oct 27 '11 at 11:05