aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Need to create customize row renderer for JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Need to create customize row renderer for JTable" Watch "Need to create customize row renderer for JTable" New topic
Author

Need to create customize row renderer for JTable

Mahesh Kedari
Ranch Hand

Joined: Nov 28, 2009
Posts: 111
Hi all,
I am trying to create customize row renderer for JTable.
My requirements are as below.

|------------|----------------|--------------|--------------|-----|------------|
|Category | Product ID |Description | Unit Price |Qty | Sub-Total|
|------------|----------------|--------------|--------------|-----|------------|


I have designed a combobox for category and product ID columns inside JTable. I want to put a listener on Category ID such that product IDs in selected categories will be visible in product ID drop down of selected row keeping other rows unchanged.
Column renderer is defining a class for entire column but by setting that im getting same values in all the rows for product IDs. And if I update values for one product ID dropdown, entire column data is changing.
Even im not able to put array of combobox for product ID column as number of rows are not fixed and increasing runtime.

Can anyone suggest me how can i customize Cells under particular column with JComboBox?

Regards,
Mahesh Kedari - Fidus Technologies Ltd.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2203
    
    7
Cross posted: http://forums.sun.com/thread.jspa?threadID=5427297&tstart=0

Be Forthright When Cross Posting To Other Sites
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need to create customize row renderer for JTable