Hello again,

I'm trying to do two things in a Swing program, and I was wondering if 
there was Swing/AWT support for doing these:

1) Flash the window bar to bring it to the user's attention (as many 
instant messenger clients do)
2) Check if there's another instance of the swing program running already 
and if so, quit

In "Delphi", #1 would be handled something like this:

FlashWindow(i, TRUE);   // invert the title bar
Sleep(500);                     // wait a bit
FlashWindow(i, TRUE);   // invert again

But I haven't found any corresponding Swing functionality.

I can always do #2 by doing something like having the client open up a 
server socket on some unlikely port, and any client which cannot will exit 
(because it will have been opened by the first one). However; this is prone 
to problems with a poor port. In windows programs, you can "FindWindow" or 
walk the process tree to see if your program is already running; how do you 
do it in a Swing program?

Thanks,

Doug


_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to