Valhalla Legends Forums Archive | Java Programming | How do I set just a specific area to trigger the actionPerformed() method?

AuthorMessageTime
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.
May 16, 2007, 4:19 AM
HdxBmx27
1.4.2 API MouseListener
Then you can use evt.getX() and .getY() to figure if its in the space you want.
~Hdx
May 24, 2007, 12:11 AM
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.
June 14, 2007, 8:07 AM

Search