• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDialog question  RSS feed

 
Sandeep DSouza
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was wondering if it it possible to pass a Resultset ( got from a database) to a JDialog .. display it in a JTable in the Dialog .. and return back to the frame the row that is selected .

need some help on this one.. if possible give some sample code
Thanks.
 
Jason Steele
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't tried it....but
If you extend the JDialog and add a Constructor that references a ResultSet and parent frame, or if you add a method to your custom JDialog, say, setResultSet(ResultSet rs) then you would most definitely be able to use a ResultSet. Then in parent frame create a method like setSelectedRow('Structure to return') and call it from the JDialog - parent.setSelectedRow('Row Data').
 
Ken Krebs
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you want to try building a ResultSetTableModel supplying it with your ResultSet and metadata.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!