• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing a JScrollPane to a JDialog

 
Rames Raja
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am passing a JScrollPane from my applet to a JDialog so that I can display the same table that resides inside my JScrollPane.
My dialog is displaying the JScrollPane well , but it seems like my JScrollPane is being removed from my original applet. Applet no longer displays the JScrollPane.
Here is how I call my JDialog
new PrintDialog( new javax.swing.JFrame(),true ,VSW_scrollPane ,this ).show();

and inside my PrintDialog I am adding VSW_scrollPane ( js ) to a panel:
middlePanel.add(js , java.awt.BorderLayout.CENTER);

what you think the problem is ??
Thanks in advance.
Ramesh
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't make out from your code whether you are adding the exact same instance of the scrollpane to your dialog or if you are making a new instance to add to the dialog. I don't think you can use the same instance of a swing component in 2 places at once... you could create a clone of the one to put in the dialog, although I don't know that you can have them both use the same table for the same reason. You'd probably have to set up a seperate table as well and just have both tables call on the same data to fill them both in.
HTH
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic