I'm trying to set 3 specific columns editable in my Jtable. Im overriding the method isCellEditable, and the method is returning true for the correct 3 columns But in the interface the columns are not editable. any ideas? here's the code.
here's where I create the model and Jtable :
Thanks for the help
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
you may have to post a working demo of the problem.
strip everything unrelated to the problem (listeners etc),
and post something we can compile/run/observe/tinker
Sabine El Rassy wrote:here's a compilable example:
Not with those imports, which include 28 unused imports that only add clutter, it isn't. Everyone doesn't have MigLayout, and I haven't a clue where the two used npt.util classes came from.
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
here's your code, rebuilt so we can run it.
added the line to make the middle column uneditable, others editable
it works fine, so the problem must be with your enums or non-standard imports
(and, no, the JScrollPane won't have anything to do with changing the editing function of a JTable)
Sabine El Rassy
Greenhorn
Joined: Jan 23, 2012
Posts: 10
posted
0
I found where the error is:
When I override the getColumnClass method, if I put the return type EnumPrice.class the cells wont be editable. If I tried with a return type of String.class it works.
Do you have any idea why the return type EnumPrice.class doesnt work?
thanks
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
> Do you have any idea why the return
> type EnumPrice.class doesnt work?
what is EnumPrice.class?
e.g. a label, a textfield, some-other-component?
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.