I am using JinternalFrames in JFrame(JDesktopPane). I am getting
difficulty in navigation in them...Let us say I have two
Jinternalframes student & courses. I can set links to them from JFrame
by using JMenubar. But when I try to set their link (as a requirement)
inside Jinternal frame like From Student JinternalFrame when a button
clicked it opens Course JinternalFrame in JdesktopPane but In Student
JinternalFrame i did not have accesisbility of JDesktopPane instance to
do work
have any suggestion please post it soon with details(and if possible
with example)
Regards
Lodhi
jgui123@yahoo.com - 17 Mar 2005 22:25 GMT
If I understand this correctly you have a JDesktopPane which contains
a JInternalFrame "Student".
If the user is on the "Student" JInternalFrame - you want them to be
able to click on a button and opens the "Course" JInternalFrame. Is
that correct?
The following is pseudo code which will do that .... this will add a
JInternalFrame to the same JDesktopPane as an existing frame.
...... from inside a class which derives JInternalFrame......
JDesktopPane mycontainer = this.getDesktopPane();
mycontainer.add( new MyCustomerJInternalFrame("Course") );
If you suspect the "Course" JInternalFrame is already open - you can
find it using....
JDesktopPane mycontainer = this.getDesktopPane();
JInternalFrame[] frames = mycontainer.getAllFrames();
for ( int i = 0; i < frames.length; i ++ ) {
if ( frames[i].getTitle().equals("Course") ) {
// that's it
}
}
Jay