This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SystemTray and task bar

 
Carey Brown
Ranch Hand
Pie
Posts: 1070
11
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to create a program that is controlled entirely via the SystemTray and does NOT require any presence on the Windows task bar. The SystemTray part of the problem is not an issue. I've written some SystemTray code in the past. What I don't know how to do is prevent a running java program from appearing on the task bar. Any suggestions would be appreciated. Is this even possible?
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use a JWindow instead of a JFrame for your UI, it does not show up on the taskbar.
 
Rob Spoor
Sheriff
Pie
Posts: 20380
45
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or a non-modal JDialog.

Moving to our user interface forum.
 
Carey Brown
Ranch Hand
Pie
Posts: 1070
11
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your feedback! I'll read up on both of those solutions.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
note that a JWindow without a visible parent will not allow focus for typing in textfields etc
if you do require focus, there is a workaround/hack that eliminates the visible parent i.e. does not appear in taskbar
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is interesting. I was not aware of this one.
I just ran a small test and looks like JTextComponents and their children indeed do not receive focus. However, components like JCheckBox JButton, JTree do.

Michael, could you please share the hack?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just need to tell the JWindow it has a visible parent, even though it doesn't

 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah! I forgot all about isShowing and kept fiddling with setVisible. Duh!
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic