Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

HearYouMe

[java] limiting mouse and textfield stuff... read for info..

This topic is 6350 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

first thanks to everyone who posted in my other threads. anyway TextFields: is there a way to limit what people can type in them? like only numbers? or is there a way to set a max length allowed to be typed in? Mouse Stuff: Say that you move the mouse onto the applet... is there a way once its on there to limit like where the mouse can move? like only in a small box?

Share this post


Link to post
Share on other sites
Advertisement
textfield :
not sure, try setColumns(int)

limits mouse:
dont think so.. since the mouse doesnt belong to the java system.

{ Stating the obvious never helped any situation !! }

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
yes there is a way to control what they can put in a text field. I''ve never done it myself though, but I think I got the idea. It involves subclassing the component and intercepting messages. You''ll have to override some methods, I think they are the various process methods. (in newer versions, they have different names and parameters in the old versions) So you get the event and if it isn''t something you want them to type you just ignore it, otherwise you call super.methodInQuestion

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!