File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Help me out in JTable Cell creation

AjayKumar Kanukuntla

Joined: Oct 18, 2001
Posts: 6
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.
I agree. Here's the link:
subject: Help me out in JTable Cell creation
It's not a secret anymore!