This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How do we add JLabel with leading Icon into JTable Cell Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How do we add JLabel with leading Icon into JTable Cell" Watch "How do we add JLabel with leading Icon into JTable Cell" New topic
Author

How do we add JLabel with leading Icon into JTable Cell

Deva
Greenhorn

Joined: Nov 05, 2004
Posts: 4
I really want to add a JLabel with Icon & label name as (JLabel) into JTabel's cell. can any one help me ???
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
You need to have a look at Sun's site for the tutorial on using Tables. Wha you are going to need to do is use a TableCellRenderer to put that lable into a JTable cell. If you look in your API at the JTable, there is a link to the tutorial called "How to use tables". Look carefully at the renderer and then ask some more specific questions.

Cheers,
Rachel
 
GeeCON Prague 2014
 
subject: How do we add JLabel with leading Icon into JTable Cell