creating an internalFrame  
Author Message
Daniel Moritz





PostPosted: 2003-7-9 22:03:00 Top

java-programmer, creating an internalFrame I'm trying to create an instance of the JInternalFrame class, which
works fine.
I defined a JDesktopPane named desktop and I am able to add an internal
Frame to this JDesktopPane.
Inside this JInternalFrame (lets call ist Frame1) I got a button which
"should" open another JInternalFrame called Frame2 inside the same
desktop. But it doesn't work. The compiler says it doesn't recognize the
variable "desktop".
How do I get him to refer to the current instance of the JDesktopPane
I'm using? I have just one JDesktopPane as my workspace.
thx in advance,
Daniel

 
Daniel Moritz





PostPosted: 2003-7-9 22:13:00 Top

java-programmer >> creating an internalFrame Daniel Moritz wrote:
> I'm trying to create an instance of the JInternalFrame class, which
> works fine.
> I defined a JDesktopPane named desktop and I am able to add an internal
> Frame to this JDesktopPane.
> Inside this JInternalFrame (lets call ist Frame1) I got a button which
> "should" open another JInternalFrame called Frame2 inside the same
> desktop. But it doesn't work. The compiler says it doesn't recognize the
> variable "desktop".
> How do I get him to refer to the current instance of the JDesktopPane
> I'm using? I have just one JDesktopPane as my workspace.
> thx in advance,
> Daniel
>
I tried to get the JDesktopPane by the following code:

myFrame Frame2 = new myFrame();
JDesktopPane myDesktop = getDesktopPane();
myDesktop.add(Frame2);

Now the compiler doesn't throw an error message, but it doesn't work
either. Any idea what I'm doing wrong?

 
Daniel Moritz





PostPosted: 2003-7-10 3:31:00 Top

java-programmer >> creating an internalFrame Daniel Moritz wrote:
> Daniel Moritz wrote:
>
>> I'm trying to create an instance of the JInternalFrame class, which
>> works fine.
>> I defined a JDesktopPane named desktop and I am able to add an
>> internal Frame to this JDesktopPane.
>> Inside this JInternalFrame (lets call ist Frame1) I got a button which
>> "should" open another JInternalFrame called Frame2 inside the same
>> desktop. But it doesn't work. The compiler says it doesn't recognize
>> the variable "desktop".
>> How do I get him to refer to the current instance of the JDesktopPane
>> I'm using? I have just one JDesktopPane as my workspace.
>> thx in advance,
>> Daniel
>>
> I tried to get the JDesktopPane by the following code:
>
> myFrame Frame2 = new myFrame();
> JDesktopPane myDesktop = getDesktopPane();
> myDesktop.add(Frame2);
>
> Now the compiler doesn't throw an error message, but it doesn't work
> either. Any idea what I'm doing wrong?
>
Figured it out.
Whomever it may concern:
I forgot to make the new Frame visible.