• 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

Passing a JScrollPane to a JDialog

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic