I have several JInternal Frames in a larger JFrame window and am implementing a window menu in the menubar. However, I have failed to work out how to bring a chosen window to the front??? Anyhelp
Printable View
I have several JInternal Frames in a larger JFrame window and am implementing a window menu in the menubar. However, I have failed to work out how to bring a chosen window to the front??? Anyhelp
This is how i do it. Where index is the index of the frame to select.
I've actually created an MDIDesktopManager class which has a createWindowMenu() method which returns the menu. It then deals with changes in the desktop pane and also deals with Tiling and cascading.Code:JInternalFrame[] allFrames = desktop.getAllFrames();
desktop.getDesktopManager().activateFrame(allFrames[index]);
try{allFrames[index].setSelected(true);}
catch(Exception e){System.out.println(e.getMessage());}
I can post it if you want.
Mrs Kensington
I wouldnt mind if you'd post it If it isn't a problem.
I've written the cascading and tiling etc.. Just was having problems getting the top window to focus
Here you go...
Just add it to your desktop pane as a DesktopManager
Stupid forum doesn't allow me uploading a .java file (tho it allows .cpp) so it's been zipped
Thanks for that.
I got it working already but I'll check out your source anyway.