• Post Reply Bookmark Topic Watch Topic
  • New Topic

using JList instead of JTable?  RSS feed

 
Mohammad Maynul Islam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can I use Jlist instead of Jtable for showing database table data (select * from employee) in my code? If anyone can please help me with code example.
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the ranch.

How come you think a JList will better represent tabular data from the database?
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohammad Maynul Islam wrote:Can I use Jlist instead of Jtable for showing database table data (select * from employee) in my code? If anyone can please help me with code example.

I'm no expert on this stuff, but my question would be: why would you?

It's certainly possible that you might be able to do it, and for creating a set of "selectable rows" it might be the best thing (honestly don't know) but, since JTable is specifically designed for displaying grids (or "rows") of values, it seems odd that you would want to use something else.

Winston
 
Mohammad Maynul Islam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You right. But I have a curiosity in my mind if it possible or something else ( java component ) could we use or not.
Like other language(V.B., probably C#) may have such services.

Thanking you
Maynul
 
Rob Camick
Ranch Hand
Posts: 2801
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the JLIst API and follow the link to the Swing tutorial on How to Use Lists. There you will find information on creating a custom "renderer". With a custom renderer you can display/format the text any way you want.
 
Mohammad Maynul Islam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!