• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need Help urgently

 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • 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
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!