aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Help me out in JTable Cell creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Help me out in JTable Cell creation" Watch "Help me out in JTable Cell creation" New topic
Author

Help me out in JTable Cell creation

AjayKumar Kanukuntla
Greenhorn

Joined: Oct 18, 2001
Posts: 6
hi,
i tried to create a JTable where in, i got only one column and several rows.
the problem is, i want to display a line of text in each row, and in that string, i want to make some portion italic/bold.
i could only display the string in table. but i could not find a way to make some portion of it bold/italic.
Plz do help me out.
Mail me
Thomas Suer
Ranch Hand

Joined: Sep 03, 2001
Posts: 50
The tables default cell renderer is inherited from JLabel. JLabel doesn't meet your requirements. So, 'all' you have to do is to implement your own cell renderer, that is extending an appropriate gui component (I suppose JEditorPane or JTextPane would be the right one???) and implementing the TableCellRenderer interface. http://java.sun.com/docs/books/tutorial/uiswing/components/text.html http://java.sun.com/j2se/1.3/docs/api/javax/swing/table/TableCellRenderer.html
Tom
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help me out in JTable Cell creation