• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable needed Within a JCombobox  RSS feed

 
karthick Natarajan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need the JComboBox to show not one set of values but a pair of values. I need to override the default way in which the values are shown. I need to display more than one column of data.So basically a JTable should be shown within a JComboBox's drop down list. I have been able to replace every item in the list by a label, with a picture and even a JTree. (This example is available in the demo provided with the jdk1.2.1 version. So I anyone has a code for it, Please let me know ASAP. Thanks.
 
kamalakar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hai natarajan..,
On 3 rd september you asked one Question.i got same problem .So, if you know answer for that question
please reply me for this query.this is urgent.thank you.
My personal-Id is : kamalakar_reddy@yahoo.com

Once again Query is :
I need the JComboBox to show not one set of values but a pair of values. I need to override the default way in which the values are shown. I need to display more than one column of data.So basically a JTable should be shown within a JComboBox's drop down list.
 
sarala peach
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kamalakar:
I have a similar requirement(i.e) to display a jtable within a JCombobox.
Could you please send me the code if you have it.
Thanks for your help,
sarala
 
Irena Puh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also need something like that. Please let me know if you solve this issue.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having problems understanding the need for a JTable within a JComboBox. Could you 2 explain a little better. There may be a better way to do what you want.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need a JTable in the combo box for this... all you have to do is make a custom ListCellRenderer that uses a label for each "column" of data you need.

Also,

"kamalakar", please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!