• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Help urgently

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I am completly stucked with something.
scenario:

A JFrame has a splitpane. on left side of splitpane i am adding a JPanel which is a seperate class so i do something like splitPane.setLeftComponent(new EventTablePanel()); and similarly on the right side i do splitPane.setRightComponent(new EventObjectPanel());

EventTablePanel class is extending JPanel and has some small local panels and some panels which are seperate classes.

Now when an user encounters some problem with some backend operation, i show a message dialog. but at the same time, when user clicks on "OK" of the message dialog, i like to clear the content pane of the JFrame with everything in it except MENU BAR. so that user can again select files and whatever.

EventTablePanel has a reference of JFrame, which i pass when i call splitPane.setLeftComponent(new EventTablePanel(MyFrame.this));

when an exception is encountered. i do something like.


the contentPane of the JFrame is not removing any of its component.

can someone help me out on urgent basis regarding this.


regards
Akhil Jain
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the message dialog get shown? What happens after that in the code? You're not accidentally returning from the hander, then?
 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the message dialog gets shown. and after user clicks ok.

I am doing this.




can you help me out.



regards
Akhil

[ November 27, 2007: Message edited by: Akhil Jain ]
[ November 27, 2007: Message edited by: Akhil Jain ]
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We'll never find any errors looking at just your *description* of the code, since you're going to describe code that works, of course. It's the differences between what you *think* you've got, and what you've really got, that make the difference.

Anyway, the first thing I would try would be to put System.out.println("1"), ("2"), and ("3") after the three lines "owner.getContentPane().removeAll()", etc, to make sure they're executing.

I also suspect you might want to call validate() on getContentPane(), not on the JFrame itself, although I'm not positive of that. The JFrame's LayoutManager may not care that the content pane has been emptied.
 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can i send my code to you in pvt.
since its too long to be pasted here.

that will give you a proper insight.
 
Ever since I found this suit I've felt strange new needs. And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic