This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jtable with Multiple Components in a Row

 
Rohit Kedia
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider a situation , In a JTable I have 3 columns
Now on checking a Check-box in column No. 2 the column no. 3 will have a JTextBox .
That is the column no 3 will have a JTextBox only if the Check box is Checked.
 
Rob Spoor
Sheriff
Pie
Posts: 20605
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Override isCellEditable to return true only of getValueAt for the other cell returns Boolean.TRUE.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not bad, you're battin' a thousand (2 from 2)

http://www.java-forums.org/awt-swing/28153-jtable-multiple-components-row.html
 
Rohit Kedia
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I have an issue related something like this.
I have 14 colums in a JTable, now in column 10 whenever I am checking that Checkbox then in Column 12 (Here I have a JtextBox with a Button) , the celleditor will be changed to a simple Jtextbox.

Please help me.

 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Rohit Kedia
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can remove that , but please help me out.
Or let me know if you want me to Start a New Thread.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the default editor is a 'textbox', so Rob gave you the answer in the first reply
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic