• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Close Group function via taskbar right-click menu

 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In WindowsXP, if you have multiple windows of a program (ex: many notepads, browser windows, etc), program titles on the taskbar gets grouped under the common name. (assumed that user have checked "Group similar taskbar buttons" in "Taskbar and Start menu Properties")

This allows user to right-click on grouped program taskbox on the taskbar and click "Close Group" that closes all the windows/instances of the group. How to handle this in a java application that has similar behavior(multiple windows) ?

There are several other related issues such as icon / task bar name changes upon taskbar grouping in Windows, which seems the only way around is to have a exe wrapper. (even if it doesn't seems to be the best solution)
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dilshan Edirisuriya:
How to handle this in a java application that has similar behavior(multiple windows) ?



Why do you need to handle it yourself? The OS already handles it for you.
Or are you talking about JDesktopPane and JInternalFrame scenario?
 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Maneesh.

Actually I have 5 separate JFrames in my application. So once i click on the close group button a message should popup asking user to save. But now when I click on the close group it happens only to a one frame not all 5 frames.

For my second issue I found a forum post. Check this.

http://forums.sun.com/thread.jspa?threadID=541940

According to this when I modify the registry entry It takes effect to the all applications which runs on the JRE. So without bundling my application in a separate JRE is there any solution?
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using a window listener and windowClosing() prompting the user to save? (The setDefaultCloseOperation should be set to DO_NOTHING_ON_CLOSE (default) )
I tried it and got prompted 5 times. How are you checking for window closing?

Of course this is not the only way. You can use Runtime#addShutdownHook(Thread hook) for example.

I don't see how the solution for the second problem can run on non Windoze platforms.
[ September 10, 2008: Message edited by: Maneesh Godbole ]
 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Maneesh

But that is not the actual scenario I want to handle. When we have multiple windows GROUPED as a single window, when we right click there is an close group option. So close group expected behavior is to close all the windows. But in my case it only affects to only one window.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic