GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Jbutton inside a jtable wont fire action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jbutton inside a jtable wont fire action" Watch "Jbutton inside a jtable wont fire action" New topic
Author

Jbutton inside a jtable wont fire action

Giskard Dors
Greenhorn

Joined: Jul 18, 2011
Posts: 2
Hi guys I have a big problem...Im trying to fire an action for a button inside a table, the problem....the button wont fire anything....
I just copyed a jtable button example and adapted it to my model.
I hope you can help me guys, thanks a lot!
the editor


the renderer


And this is the simple code:



Like I said, the button is showing, but the action isnt working at all...
when I try the code without my model it works just fine...maybe something is missing to my model, I dont know...

this is my model

Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2191
    
    7
Cross posted: http://www.java-forums.org/awt-swing/46599-jbutton-inside-jtable-wont-fire-action.html

Be Forthright When Cross Posting To Other Sites
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

I was going to suggest Rob's ButtonColumn class but he already linked to it on the other forum.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Giskard Dors
Greenhorn

Joined: Jul 18, 2011
Posts: 2
The problem was my table model...

@Override
public boolean isCellEditable(int row, int column) {
return true;
}

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Jbutton inside a jtable wont fire action