Triguna
asked on
URGENT!!!! How to add an image and a TextField Together into a JTable
Hi Experts,
I am struggling to find this,
How to add an image and a text into the same cell of a JTable?
This is something like this when seen in a JTable
[<image goes here>] Text [image 1 goes here] Text 1
[<image 2 goes here>] Text 2 [image 3 goes here] Text 3
[<image 4 goes here>] Text 4 [image 5 goes here] Text 5
Please solve this problem as soon as possible....
Thank you in advance,
regards
Triguna M S
I am struggling to find this,
How to add an image and a text into the same cell of a JTable?
This is something like this when seen in a JTable
[<image goes here>] Text [image 1 goes here] Text 1
[<image 2 goes here>] Text 2 [image 3 goes here] Text 3
[<image 4 goes here>] Text 4 [image 5 goes here] Text 5
Please solve this problem as soon as possible....
Thank you in advance,
regards
Triguna M S
Define your own CellRenderer which uses a JLabel (you can setIcon() on a JLabel, and it will appear on the left of the text)
http://www.javaalmanac.com/egs/javax.swing.table/CustRend.html
http://www.javaalmanac.com/egs/javax.swing.table/CustRend.html
ASKER
Thank you for your comments.
TimYates,
I will try that and get back to you.
TimYates,
I will try that and get back to you.
Good luck!
Let us know if you have problems!!
Tim
Let us know if you have problems!!
Tim
ASKER
TimYates,
I tried to add the ICONS but no result.
Can u please explain me with a small code?
thank you.
regads
Triguna M S
I tried to add the ICONS but no result.
Can u please explain me with a small code?
thank you.
regads
Triguna M S
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for the comment...
Tim Yates.
I will try that and will get back to you soon,
Sorry for the late reply.
Tim Yates.
I will try that and will get back to you soon,
Sorry for the late reply.
ASKER
Thank you very much. It worked for me.
Thanks a lot.
Thanks a lot.
Yay! Cool :-)
Good luck with it all :-)
Tim
Good luck with it all :-)
Tim
;JOOP!