|
-
January 15th, 1999, 02:14 PM
#1
JTable troubles
I've got some code which attemps to display a JPanel within a JTable cell, but instead the output from a JPanel.toString() appears there instead. Any ideas as to what could be wrong?
Thanks,
Chris.
-
January 15th, 1999, 03:35 PM
#2
Re: JTable troubles
Forget it.
I was trying to follow Java 2 examples using Java 1.1.6.
It didn't quite work. 
Chris
-
June 15th, 1999, 03:34 PM
#3
Re: JTable troubles
The default JTable renderer (Class based rendering) handles String, boolean and numbers.
Typically one needs to do the following
1) Create your class implementing TableCellRenderer interface and extending from any JComponent subclass (In your case extends JPanel)
2) Set the instance of the this class to the appropiate column.
e.g., <table_name>.getColumnModel().getColumn(0).setCellRenderer(<your_class> ;
This should do the job.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|