Swithcing between 2 JTables.

Discussion in 'Java' started by kjartana@gmail.com, Mar 7, 2006.

  1. Guest

    Hello.

    I'm writing a swing application that has 2 JTables on seperate
    JScrollPane. When data in table 1 is edited I submit it to a database
    (using a TableModelListener) and would then like the focus to be set to
    table 2.

    My problem is setting the focus from table 1 to table 2.

    Any help would be much appreciated.
     
    , Mar 7, 2006
    #1
    1. Advertising

  2. VisionSet Guest

    <> wrote in message
    news:...
    > Hello.
    >
    > I'm writing a swing application that has 2 JTables on seperate
    > JScrollPane. When data in table 1 is edited I submit it to a database
    > (using a TableModelListener) and would then like the focus to be set to
    > table 2.
    >
    > My problem is setting the focus from table 1 to table 2.
    >
    > Any help would be much appreciated.


    Not used it myself, but have you tried java.awt.FocusTraversalPolicy?
    You should be able to do it so you don't need a reference to the other
    table.

    <http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html>

    --
    Mike W
     
    VisionSet, Mar 7, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. G.Schiber

    an array of JTables

    G.Schiber, Sep 14, 2003, in forum: Java
    Replies:
    3
    Views:
    861
    Matt Humphrey
    Sep 15, 2003
  2. BNM

    JButtons in JTables

    BNM, Jan 30, 2004, in forum: Java
    Replies:
    0
    Views:
    495
  3. freesoft_2000

    JTables

    freesoft_2000, Feb 8, 2005, in forum: Java
    Replies:
    1
    Views:
    706
    Andrew Thompson
    Feb 9, 2005
  4. freesoft_2000

    JTables

    freesoft_2000, Jun 23, 2005, in forum: Java
    Replies:
    1
    Views:
    545
    Andrew Thompson
    Jul 4, 2005
  5. Replies:
    4
    Views:
    528
    Chase Preuninger
    Apr 27, 2008
Loading...

Share This Page