Results 1 to 2 of 2
  1. #1
    varun2002 is offline Member
    Join Date
    Apr 2008
    Posts
    1
    Rep Power
    0

    Post Swing Tables - urgent

    Hi,
    i have two Swing tables.I wnat to do select a row from one table automatically will select the smae index row of another table.How to do?

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    Get the row selected in the first table and set that same row selected in the second table.
    To get the selected row of the first table you can add a ListSelectionListener to the SelectionModel to get the leadSelectionIndex from within its valueChanged method or you can add a MouseListener to the table and use the rowAtPoint method to get the row index.
    To change the selection of the second table you can use the changeSelection method.

Similar Threads

  1. Listing tables of a database
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-12-2008, 10:30 AM
  2. caching the tables
    By jayashree in forum JDBC
    Replies: 0
    Last Post: 01-30-2008, 07:43 AM
  3. how to sort 2 tables
    By valery in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 09:30 PM
  4. Updating into 2 tables in the DB
    By yuchuang in forum New To Java
    Replies: 2
    Last Post: 05-12-2007, 07:54 AM
  5. Tables In Ejb3
    By Alan in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 05-10-2007, 05:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •