• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jlist or Jtable?

 
Emili Calonge
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create a list of files, where I want to show more tahn one field on each row, for example, I want to show a file name, size, date,... Can I do this thith a list or I have to use JTable, because I don't know how to do it with JLits. I need to be able to select a row and then work with it's content, is it posible with JTable?? Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a multi-columned Jlist is simple enough, but the task sounds
as though a JTable would be a better option
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would definitely go with JTable. You'll have column headers and the user
will be able to resize columns (long file names)!
 
Emili Calonge
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, I'll go with JTable, but can anyone tell me how I can do something with the selected row??
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Emili Calonge:
Thanks a lot, I'll go with JTable, but can anyone tell me how I can do something with the selected row??


Too vague. Are you asking:
* how to be notified when the selection changes?
* how to get the selected row(s)?
* how to get data from the model of the table?
* what you can do ??? with data?
* how to *change* data in the model of the table?

Be clear.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic