Questions tagged [tablecelleditor]
339 questions
16
votes
1 answer
How to add a drop down menu to a JTable cell
This may be a question asked before. I searched a lot before posting here, but couldn't figure out any acceptable one.
Can some one show me a way how to do this. I simply need to get a drop down menu when i click on the cell so that I'll have to…

Anubis
- 6,995
- 14
- 56
- 87
13
votes
2 answers
Adding JComboBox to a JTable cell
Possible Duplicate:
How to add a JComboBox to a JTable cell?
I'm finding it difficult to add JComboBox to one of the cells of a JTable, I tried the code below but it's not working..
How can I add jcombobox to a particular cell?
On pressing enter…

c.pramod
- 606
- 1
- 8
- 22
12
votes
4 answers
How to implement dynamic GUI in swing
First of all, apologies for posting something perhaps a bit excessively specific, but I'm not very experienced with Swing, and can't seem to find good examples that fit my needs.
So I'm trying to figure out the best way to implement the a dynamic…

Rolf
- 2,178
- 4
- 18
- 29
11
votes
4 answers
How to mark JTable cell input as invalid?
If I take a JTable and specify a column's classtype on it's model as follows:
DefaultTableModel model = new DefaultTableModel(columnNames, 100) {
@Override
public Class> getColumnClass(int columnIndex) {
return…

Cuga
- 17,668
- 31
- 111
- 166
10
votes
2 answers
How to use custom JTable cell editor and cell renderer
I have created a JTable with a custom table render and custom cell editor which gives the result in the image
I created the panel shown in the first table cells using a separate class which extended JPanel. and add table values as,
…

Harsha
- 3,548
- 20
- 52
- 75
9
votes
3 answers
JTable Cell Update doesn't work
In my application I have use a java table which is similar to this example. My problem is when I change a value of a cell (even in above example) the data model doesn't get updated until I click on a different cell. Even I click on the gray area…

nath
- 2,848
- 12
- 45
- 75
9
votes
1 answer
How to maintain JTable cell rendering after cell edit
You guys were so awesome in point me in the right direction on my last question and I have sort of an extension of my original question here:
How to set a JTable column as String and sort as Double?
As I now have my price column formatted as…

titanic_fanatic
- 593
- 2
- 5
- 13
8
votes
3 answers
SelectBooleanCheckbox in editable DataTable doesn't change
I have a dataTable that is editable (editMode = "cell").
Editing free text field and list box is quite straightforward. However, I cannot figure out how to edit checkbox field. To be more specific when I try to edit checkbox selection, the data in…

gawi
- 2,843
- 4
- 29
- 44
8
votes
1 answer
Setting focus AND blinking cursor on specific JTable cell
I have a very simple problem here.
When the user clicks on an "Edit" button after he has selected a row in my JTable, the software checks if this row is allowed to be edited.
If it is, I would like to put the focus in the first cell of that row…

Zek101
- 203
- 4
- 13
7
votes
3 answers
How can I get the component at the mouse click position, when using a TableCellEditor?
I use a custom TableCellRenderer with multiple JFormattedTextField in the table cells. I use the same component as TableCellEditor. Now I need to know in what JFormattedTextField the user clicked, and also where in this field (can be done with…

Jonas
- 121,568
- 97
- 310
- 388
7
votes
1 answer
How do I get the CellRow when there is an ItemEvent in the JComboBox within the cell
I have a JTable with a column containing a JComboBox.
I have an ItemListener attached to the JComboBox which acts upon any changes.
However, ItemListener does not have a method for obtaining the Row that the changed ComboBox is within.
I need to Row…

JeffS
- 327
- 7
- 17
7
votes
4 answers
JTable cell editor number format
I need to show numbers in jTable with exact 2 decimal places. To accomplish this I have created a custom cell editor as:
public class NumberCellEditor extends DefaultCellEditor {
public NumberCellEditor(){
super(new…

Khalid Amin
- 872
- 3
- 12
- 26
7
votes
3 answers
Why is cancelCellEditing() not called when pressing escape while editing a JTable cell?
I have an editable JTable and have set a DefaultCellEditor like so:
colModel.getColumn( 1 ).setCellEditor( new DefaultCellEditor( txtEditBox ) {
// ...
@Override
public void cancelCellEditing() {
…

Epaga
- 38,231
- 58
- 157
- 245
7
votes
2 answers
Make JTable cell editor value be selectable, but not editable?
I have tried to keep my JTable's tight and secure, making only editable columns editable via isCellEditable(). However, my clients are insisting that they want to double click on a cell so they can copy its contents, even if it is read only. I could…

tmn
- 11,121
- 15
- 56
- 112
7
votes
2 answers
How to edit a JXTreeTable cell in only one mouse click?
I want to use a JComboBox as a cell editor in a JXTreeTable. It works fine with a standard DefaultCellEditor (i.e. with a click count to start equal to 2).
Now I want the column to be editable on only one click. So I added a…

Marc de Verdelhan
- 2,501
- 3
- 21
- 40