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)
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.
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 ]
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.
Dilshan Edirisuriya SCJP1.4, SCWCD1.4, SCBCD 5
Let's go to the waterfront with this tiny ad:
a bit of art, as a gift, the permaculture playing cards