• Welcome to Valhalla Legends Archive.
 

How do I set just a specific area to trigger the actionPerformed() method?

Started by Tomcat, May 15, 2007, 11:19 PM

Previous topic - Next topic

Tomcat

I want the user to click on a specific area and have something trigger as a reaction to clicking in the specific area.  I do not want this area to be specially marked whatsoever.  An invisible button, if you will.

Hdx

1.4.2 API MouseListener
Then you can use evt.getX() and .getY() to figure if its in the space you want.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Tomcat

Yeah, I figured it out. :-O  I just made a class... aww hell I haven't touched it in weeks, so I forget what I did, but it involved a separate class that was a JButton, or something like that.  Needless to say, it worked like a charm.  Email me at tomcat AT gdshadow DOT net if you've googled and come across this post and are wondering how to do this.  It's really simple, the kind of "shoot yourself in the foot" simple that makes you... well you know.