Article View: borland.public.jbuilder.java.swing
Article #600Re: JDesktopPane problem
From: Lodhi
Date: Tue, 15 Mar 2005 07:45
Date: Tue, 15 Mar 2005 07:45
107 lines
4840 bytes
4840 bytes
Thanks for your mail.
At very simple scenario...!
We have two JInternalFrames, One JIF is representing Student Contact Information, whereas the other JIF is representing Student Course Information.....
User Come and open the 'Student Contact Information Form' and enters student contact detail and then user clicks the "NEXT" button on JInternalForm of Student Contact Information. This button action displays Student Course Information Form......!
This is not working....! Navigating through buttons in JIFs.
However, if user clicks the Menubar item 'Student Contact Information' then it displays Student information form, and when user click MenuItem of 'Student Course Information' it displays the other form.
Actually one way is working and the other way is not.....!
public class Main extends JFrame implements ActionListener, InternalFrameListener
{
//here some code for jdesktoppane and menubar in jbinit
//including instance of jdpDesktop of JDesktopPane
//code for menuitems
void jMenuItem1_actionPerformed(ActionEvent e) {
JInternalFrame ct = new Student();
try {
jdpDesktop.add(ct, JLayeredPane.DEFAULT_LAYER);
ct.addInternalFrameListener(this); // Listen for events
jdpDesktop.moveToFront(ct);
ct.pack();
ct.show();
ct.setSelected(true);
} catch (PropertyVetoException ex) {
}
}
void jMenuItem2_actionPerformed(ActionEvent e) {
JInternalFrame bizt = new Course();
try {
jdpDesktop.add(bizt, JLayeredPane.DEFAULT_LAYER);
bizt.addInternalFrameListener(this); // Listen for events
jdpDesktop.moveToFront(bizt);
bizt.pack();
bizt.show();
bizt.setSelected(true);
} catch (PropertyVetoException ex) {
}
}
But If I want to go to Course InternalFrame from Student I add a JButton in Student class and want to show screen Course when user click on it
public class Student extends JInternalFrame {
//some code here
void jButton2_actionPerformed(ActionEvent e) {
JInternalFrame c=new Course();
try {
//I did not have visiblity to this variable of Main class
// jdpDesktop.add(c, JLayeredPane.DEFAULT_LAYER);
//or I create new instance of JDesktopPane and do it
JDesktopPane jdp=new JDesktopPane();
jdp.add(c, JLayeredPane.DEFAULT_LAYER);
// c.addInternalFrameListener(this); // Listen for events
jdp.moveToFront(c);
c.setSize(400,400);
c.show();
c.setSelected(true);
c.setVisible(true);
} catch (PropertyVetoException ex) {
}
}
My all tries are not working
What code I will write in above method.......
Thanks for your patience...respond soon
Regards,
Lodhi
"John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote:
>On 3/14/2005 at 4:21:15 PM, Lodhi wrote:
>
>> I am using JinternalFrames in JFrame(JDesktopPane) now . 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)
>
>I do not understand what you mean by "setting links to them using
>JMenuBar" or "accesisbility of JDesktopPane instance". If you have some
>code that is not working as you expect, it would be a good idea to post
>the actual code - ideally a complete, working example. Descriptions of
>the code are a poor substitute.
>
>--
>Regards,
>
>John McGrath [TeamB]
>
>---------------------------------------------------
>Before sending me e-mail, please read:
> http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<42369286$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<42305ee7$1@newsgroups.borland.com> <xn0dzmx91zjs8b004@newsgroups.borland.com> <4236004b$1@newsgroups.borland.com> <xn0dzr0zc54jigu00c@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,585b4c91326488b0 X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Lodhi" <atiqlodhi@gmail.com> Sender: "Lodhi" <atiqlodhi@gmail.com> Reply-To: "Lodhi" <atiqlodhi@gmail.com> Subject: Re: JDesktopPane problem Newsgroups: borland.public.jbuilder.java.swing X-User-Info: 202.125.142.174 References: <42305ee7$1@newsgroups.borland.com> <xn0dzmx91zjs8b004@newsgroups.borland.com> <4236004b$1@newsgroups.borland.com> <xn0dzr0zc54jigu00c@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <42369286$1@newsgroups.borland.com> Date: 14 Mar 2005 23:45:10 -0800 X-Trace: newsgroups.borland.com 1110872710 207.105.83.66 (14 Mar 2005 23:45:10 -0800) Lines: 108 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail