aspose file tools
The moose likes Swing / AWT / SWT and the fly likes labels and events Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "labels and events" Watch "labels and events" New topic
Author

labels and events

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
i am working on a uni assignment and we have to make a calculator using labels. I am having troulbe associating a mouce click with a label.
Can this be done and if so how???
thank you david
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
hi,
attach a MouseListener to the labels:
label.addMouseListener(new MouseAdapter()
{
/* implement the interface methods:
* the code that shall be executed in reaction
* on mouse events.
*/
});
this method is inherited from java.awt.Component.
chantal
david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
thank you for that it is now working fine
david
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: labels and events
 
Similar Threads
Swing save dialog
CEWOLF-LABELS
How to remove label
sliders
Swing save dialog