Results 1 to 3 of 3
- 08-29-2011, 12:16 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 42
- Rep Power
- 0
firing an event as soon as value (in SpinnerNumber model) is deleted
I have created hours and minutes using JSpinner()(SpinnerNumberModel).
private JSpinner spHrs;
private JSpinner spMin;
this.spHrs = new JSpinner();
this.spMin= new JSpinner();
this.spHrs.setModel(new SpinnerNumberModel(0, 0, 999, 1));
this.spMin.setModel(new SpinnerNumberModel(0, 0, 59, 1);;
User is required to select hours(range 1-999) and min(range 1-59) and then click save.
Problem is that whenever user deletes any value in spHours model,and then click save
the original value is restored since the spHours(or spMinutes) cannot take any null value or any alphanumeric value.
Requirement is..
whenever user deletes any value in sphrs or spMin, a dialog box should appear asking "Do you want to restore the original value or replace the vaue with 0"
Anyway my problem is that,I am not able to fire any event on deleting the value,it gets restored as soon as I go to change the value of spmin and vice versa?
Any help is highly appreciated..
Thanks
- 08-29-2011, 12:40 PM #2
Why aren't you using a SpinnerDateModel?
db
- 08-29-2011, 12:47 PM #3
Member
- Join Date
- Mar 2009
- Posts
- 42
- Rep Power
- 0
Similar Threads
-
How to stop a JList from firing events when contents is updated?
By SeanC in forum AWT / SwingReplies: 3Last Post: 04-06-2011, 03:48 AM -
nodeChanged() not firing/working?
By PrinceSendai in forum AWT / SwingReplies: 2Last Post: 03-24-2011, 03:29 AM -
setText is not firing...! Why?
By N00Bie in forum New To JavaReplies: 14Last Post: 02-20-2011, 09:59 PM -
Event-Driven Painting With Data Model
By ThatJavaGuy in forum Java 2DReplies: 6Last Post: 02-15-2011, 03:58 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks