简体   繁体   中英

Can you set the window title for a java application as a command line parameter?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM