aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Swing Jdesktop pane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing Jdesktop pane" Watch "Swing Jdesktop pane" New topic
Author

Swing Jdesktop pane

Nilu Deshmukh
Greenhorn

Joined: Aug 03, 2009
Posts: 22
Hi,
I am new to Swing.
I am creating a MDI Application. In my application am using menus. On menus select option
i want to call that selected panel.
the panel code is written in another file...

The code is working fine if I am writing the Whole code in one file..
But if i create another class and write panel code in that class.
and when i create object of that class in main class. Its not displaying the panle code in
desktop pane.
the panle is being displayed out of frame..

what would be the solution.

Please help...
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> what would be the solution.

post your code?
Nilu Deshmukh
Greenhorn

Joined: Aug 03, 2009
Posts: 22
NewReport.java


ReportPanel.java
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
seems to work the same way to me, either way - all as a single .java file, or as separate .java files

all in ReportPanel() is added to a separate JFrame, so it would be correct to appear 'outside' of the initial JDesktopPane/JFrame

perhaps what you need to do is pass a reference of the first JDesktopPane 'desk' when you create ReportPanel(...),
then add reportpanel's JInternalFrame to 'desk', rather than to a newly created JDesktopPane/JFrame
Nilu Deshmukh
Greenhorn

Joined: Aug 03, 2009
Posts: 22
Thanks Michael.
I got the solution. Now I can open the selected Panel on Click event of menu Item.

But now when I open the selected Panel and close the panel. after closing the panel I am not able ro reopen it... Its displaying nothing.. what would be the Issue...

on click even I am calling this method...


Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
it no longer compiles with that changed method, so I can't help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Swing Jdesktop pane
 
Similar Threads
Can it be solved other than using inner class?
Reading a file in ScrollPane
call paint method on a JPanel
JButton Action Listener Problem
convert swing to applet