Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > select rows

Reply
Thread Tools

select rows

 
 
pat270881
Guest
Posts: n/a
 
      04-08-2005
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

 
Reply With Quote
 
 
 
 
Thomas Fritsch
Guest
Posts: n/a
 
      04-08-2005
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.SING LE_SELECTION);

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

--
"Thomas:Fritsch$ops:de".replace(':','.').replace(' $','@')

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rows the rows of a grid view? Jason James ASP .Net 0 08-10-2006 09:24 PM
dynamically add new rows and save data typed in these rows to a database Arjen Hoekstra ASP .Net 0 08-02-2005 12:15 PM
convert rows to columns and columns to rows helpful sql ASP .Net 0 05-19-2005 06:03 PM
script for moving rows up and down and traverse thru rows of HTML table Subba Rao via DotNetMonster.com ASP .Net 0 03-19-2005 06:46 AM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM



Advertisments