Bookmark Topic Watch Topic
  • New Topic

CellEditor

 
Prashanth Bhanu
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi Brian,

Well thanks for the link.Thanks to Gregg as well.Wlll,I've understood editer and renderer to large extent.By using renderer i managed to achive what i wanted on a JTable.
Now I have a Java class which would create me a specific JButton and will return that created JButton upon calling a method which is inside that class.
Now i have another class where i'm having a JTable and i want to add a JButton which is obtained from the above class to this Jtable.But i cant do some thing like
Jtable.getColumnModel().getColumn(2).setEditer(editor)
Because all the button which will sit in subsequent cells will be having different label on them ex:new JButton("Gregg"),
new JButton("Cole") etc..
So i'm having difficulty to incorporate this.Can you please suggest me to use this Button as Editor to my particular colums cells in the Jtable.

Thanks in advance

Prashanth
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Seems like you meant to put this response in this thread rather than starting a new thread all together. I am closing this one and will copy your response to the new one.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic