Results 1 to 6 of 6
  1. #1
    cowboy is offline Member
    Join Date
    Oct 2009
    Posts
    48
    Rep Power
    0

    Default A problem with JScrollBar and the Jbutton


    In JscrollBar i can change the date value by the integrated buttons(1). This button increase or reduce the value of day of month by 1. I placed on my form another two buttons(2).this is a code described those behavior :
    Java Code:
         
       SpinnerDateModel model = (SpinnerDateModel)jSpinner1.getModel();
            Calendar calendar = Calendar.getInstance();
            java.util.Date date=model.getDate();
            calendar.setTime(date);
            calendar.add(Calendar.HOUR, -1);
            
    
            java.util.Date initDate=calendar.getTime();
            java.util.Date earliestDate=calendar.getTime();
            java.util.Date latestDate=calendar.getTime();
    
            model = new SpinnerDateModel(initDate,earliestDate,latestDate, Calendar.YEAR);
      
            jSpinner1.setModel(model);
    By this button i change a hour value by 1 up or down.But after i done it (change the hour value) i can not change the date value by the button 1 !!!.I press the upper-button on jscrollbar and it do nothing! Thats the problem?

  2. #2
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default

    Can we see how you change your current time?
    + It might be because ur running vista, then u must run the IDE with admin power to give it authorithy to adjust such settings on your computer.

  3. #3
    cowboy is offline Member
    Join Date
    Oct 2009
    Posts
    48
    Rep Power
    0

    Default

    Quote Originally Posted by Addez View Post
    Can we see how you change your current time?
    + It might be because ur running vista, then u must run the IDE with admin power to give it authorithy to adjust such settings on your computer.
    I am running an XP. What kind of time do you mean?SYstem time?

    I change a time in jScrollBar by using integrated buttons and i created an another button for change the hour value

  4. #4
    cowboy is offline Member
    Join Date
    Oct 2009
    Posts
    48
    Rep Power
    0

    Default

    The problem is still appear.

  5. #5
    cowboy is offline Member
    Join Date
    Oct 2009
    Posts
    48
    Rep Power
    0

    Default

    Sorry but i can not resolve this problem still.. This is my project. I ask somebody to help me
    Скачать IV.rar с WebFile.RU

  6. #6
    cowboy is offline Member
    Join Date
    Oct 2009
    Posts
    48
    Rep Power
    0

    Default

    THe problem had resolved.The inittime ? ealest and the latest was the same value.

Similar Threads

  1. JScrollBar
    By solomon_13000 in forum AWT / Swing
    Replies: 1
    Last Post: 07-01-2009, 07:46 AM
  2. Problem on adding JButton on JPanel NEED HELP
    By boisk in forum AWT / Swing
    Replies: 15
    Last Post: 03-15-2009, 02:27 PM
  3. JButton Problem
    By wassim in forum AWT / Swing
    Replies: 6
    Last Post: 02-18-2009, 10:29 PM
  4. problem with jscrollbar in my applet
    By leonard in forum Java Applets
    Replies: 1
    Last Post: 08-03-2007, 11:39 PM
  5. Problem with JButton
    By Marcus in forum AWT / Swing
    Replies: 1
    Last Post: 07-05-2007, 05:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •