Link to home
Start Free TrialLog in
Avatar of xiaoxiangz
xiaoxiangz

asked on

JLable with Jcheckbox

Hi,
   I am using
JLabel(String text, Icon icon, int horizontalAlignment)

to write code for a image browser.  Right now it displays thumb nail images with
file name on top.
I want to put a checkbox next to file name for user to
select or deselct the image. How can I extend the JLable
class so it not only take a icon, a text string, but
also a checkbox?

Thanks.
shane
Avatar of girionis
girionis
Flag of Greece image

 Why do you need to extend JLabel? Can you not just add a check box next to the JLabel and enable/disable the thumbnail? If checkbox is enabled then call the J:Label's constructor that does not require an Icon sa parameter, if it is not enabled called the one that does.

  Hope it helps.
ASKER CERTIFIED SOLUTION
Avatar of randyd
randyd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial