select rows

Discussion in 'Java' started by pat270881, Apr 8, 2005.

  1. pat270881

    pat270881 Guest

    Hello,

    How can I realize that in a JTable that only one row is selected at one
    time? - because now when I select one row and leave the key pressed and
    pull the cursor downwards more rows are selected.

    thx

    pat
     
    pat270881, Apr 8, 2005
    #1
    1. Advertising

  2. pat270881 wrote:
    > Hello,

    Hello!
    >
    > How can I realize that in a JTable that only one row is selected at one
    > time? - because now when I select one row and leave the key pressed and
    > pull the cursor downwards more rows are selected.
    >
    > thx
    >
    > pat
    >


    It's a one-liner:
    yourTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    See also the javadoc of JTable.setSelectionMode(int) and
    ListSelectionModel.SINGLE_SELECTION

    --
    "Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')
     
    Thomas Fritsch, Apr 8, 2005
    #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. Subba Rao via DotNetMonster.com

    script for moving rows up and down and traverse thru rows of HTML table

    Subba Rao via DotNetMonster.com, Mar 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    8,345
    Subba Rao via DotNetMonster.com
    Mar 19, 2005
  2. helpful sql
    Replies:
    0
    Views:
    849
    helpful sql
    May 19, 2005
  3. Arjen Hoekstra
    Replies:
    0
    Views:
    588
    Arjen Hoekstra
    Aug 2, 2005
  4. Jason James

    Rows the rows of a grid view?

    Jason James, Aug 10, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    418
    Jason James
    Aug 10, 2006
  5. palmiere
    Replies:
    1
    Views:
    467
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page