• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Swing Jdesktop pane

 
Nilu Deshmukh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> what would be the solution.

post your code?
 
Nilu Deshmukh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NewReport.java


ReportPanel.java
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it no longer compiles with that changed method, so I can't help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic