File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Jtable with Multiple Components in a Row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jtable with Multiple Components in a Row" Watch "Jtable with Multiple Components in a Row" New topic
Author

Jtable with Multiple Components in a Row

Rohit Kedia
Ranch Hand

Joined: Apr 24, 2010
Posts: 79
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

Joined: Oct 27, 2005
Posts: 19784
    
  20

Override isCellEditable to return true only of getValueAt for the other cell returns Boolean.TRUE.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
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

Joined: Apr 24, 2010
Posts: 79
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

Joined: Jul 26, 2007
Posts: 10535
    
    9

Thanks Michael.

Rohit, like Rob told you here please refer to http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Rohit Kedia
Ranch Hand

Joined: Apr 24, 2010
Posts: 79
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

Joined: Jun 09, 2003
Posts: 4632
the default editor is a 'textbox', so Rob gave you the answer in the first reply
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jtable with Multiple Components in a Row