| Author |
getting which of the JLabels get clicked?
|
Girish Vasmatkar
Ranch Hand
Joined: Apr 24, 2008
Posts: 199
|
|
Hello to all, I have a org.jdesktop.swingx.JXTaskPane() component on my JFrame which comes as part of SwingX API. I have added many JLabels to this taskpane component and now i want to have information regarding which of the JLabels get clicked when i click one of them. Depending on which one of them get clicked i want to do different things. Just want to ask how to go about this? I tried each JLabel implement a MouseListener but i can't single one out from the list of JLabels.
|
 |
Brian Cole
Author
Ranch Hand
Joined: Sep 20, 2005
Posts: 852
|
|
Originally posted by Girish Vasmatkar: I have added many JLabels to this taskpane component and now i want to have information regarding which of the JLabels get clicked when i click one of them. Depending on which one of them get clicked i want to do different things. Just want to ask how to go about this? I tried each JLabel implement a MouseListener but i can't single one out from the list of JLabels.
The I-want-a-label-that-acts-like-a-button topic comes up periodically. The simple answer is to use an actual button and make it look like a label. Take a look at some of the older threads, for instance this one.
|
bitguru blog
|
 |
 |
|
|
subject: getting which of the JLabels get clicked?
|
|
|