Forums Register Login

problem with showMessageDialog

+Pie Number of slices to send: Send
Hi everyone,
I seem to be having trouble displaying a message dialog.My application requires user input to a textField in a specific format(say hh-mm-ss).And whenever user enters invalid i/p,a dialog should appear saying "this is the wrong format.Please enter in the format hh-mm-ss" and in the dialog there is only one button ok.when pressed the user should be prompted to enter i/p again.

I am using JOptionsPane.showMessageDialog which is showing the dialog,but my application hangs when i click ok.Can someone please help me with the listener for the ok button.
Thanks,
Thejaswini.
+Pie Number of slices to send: Send
You may want to post your code so people may see what is going on.
+Pie Number of slices to send: Send
No listener is needed. This is almost certainly unrelated to showMessageDialog() and is a problem with the code you've written that follows it.
+Pie Number of slices to send: Send
indeed. The way I validate user input is in this way:



Messages.java

+Pie Number of slices to send: Send
Thanks John,Ken & Dieter...well my code is way too long to post completely.I will post only part of it...now i have written a custom dialog with ok button and a listener for tht.Please see if it makes any sense to you...I know am doing something wrong here but not able to figure it out...



Thanks for your time.
Thejaswini.
+Pie Number of slices to send: Send
this might be one way.

needs testing to ensure the hour range is what you want

+Pie Number of slices to send: Send
Thanks everybody...John, Ken ,Dieter & Michael...now my code is working.
The basic problem seems to be the code following showMessageDialog like you suggested ken.Once again thanks to all of you.

Thejaswini.
Why fit in when you were born to stand out? - Seuss. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2477 times.
Similar Threads
Limiting the i/p for Date/time in a MaskedTextfield
how to convert string into string array
Bringing up a calender
Limiting the i/p for Date/time in a MaskedTextfield
How o Display dateformat
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 00:27:28.