This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Regarding JComboBox in a JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Regarding JComboBox in a JTable" Watch "Regarding JComboBox in a JTable" New topic
Author

Regarding JComboBox in a JTable

seema prakash
Ranch Hand

Joined: Nov 17, 2004
Posts: 59
Hi ,
I have the JTable with my last column that has to be rendered as a JComboBox. But, I'm not able to expand it and select a different value. I'm not able to find out what am I doing wrong. Please can anyone help.
My code is as follows:

seema prakash
Ranch Hand

Joined: Nov 17, 2004
Posts: 59
I did get help and the mistake was in my
class JTableButtonModel extends AbstractTableModel {
.....
public boolean isCellEditable(int row, int column) {
return false;
}
....
}


I had to change it to this

class JTableButtonModel extends AbstractTableModel {
.....
public boolean isCellEditable(int row, int column) {
// 1st solution
return true;

// or 2nd solution, make it such that only column 2 it editable
if(column == 2) {
return true;
}

return false;
}
....
}

I hope it will be helpful for someone with the similar problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding JComboBox in a JTable
 
Similar Threads
Adding a column of JRadioButtons to a JTable
JTable selected row problem
JTable with Drop down issue.
JCheckBox in JTable Rendering problem
MultiComponent JTable