iAmLearning
iAmLearning

Reputation: 1174

Java Program and Windows Taskbar

I just wrote a desktop clock for me in java-swing and I wanted that clock to run everytime I log in.
For this I added the my jar file to start folder and I got the clock running.
But my problem is- the icon shown in the taskbar that allows me to close my application by clicking the cross mark shown at mouse over (Windows 7 style) or right click->close.
I want my application to run as the other windows processes (or desktop gadgets) and not to show the icon in the taskbar.

Thanks in advance !

Upvotes: 2

Views: 3846

Answers (3)

Durandal
Durandal

Reputation: 20059

Use a JDialog instead of JFrame. Dialogs do not show in the task bar.

Upvotes: 4

lazyprogrammer
lazyprogrammer

Reputation: 629

I guess you might be interested in something like this
Put this code where you are creating the form

setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);

This disables any action on close.

Upvotes: 2

Related Questions