The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


preventing deletion

Posted by Mukul on October 23, 2001 at 5:30 AM

> hi

> I have a problem and i have tried some thing maybe not the
> correct ones

> here is a problem, I have JTextField like this

> JTextField hi = new JTextField("1", 10)

> the only problem is when the field is deleated when java is running
> than i have no
> way of knowing that field has been deleted. Is there a way I can
> protect myself from that, so that if someone trys to delete
> and run further program than i have a massage coming up
> "No Cant Do", unless the field is filled with a number.
> please help
> Thanks in advance

1. Disable the field.

If that does not serve your purpose, then you can add a keylistner to this particular text field and track the keypresses individually


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us