• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Swing Jdesktop pane

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> what would be the solution.

post your code?
 
Nilu Deshmukh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
NewReport.java


ReportPanel.java
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it no longer compiles with that changed method, so I can't help.
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic