Dice93's Profile User Rating: -----

Reputation: -3 Dishonored
Group:
Members
Active Posts:
41 (0.04 per day)
Joined:
24-December 12
Profile Views:
985
Last Active:
User is offline Jul 20 2015 02:25 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   Dice93 has not set their status

Posts I've Made

  1. In Topic: JProgressBar add 1s delay after setting value

    Posted 18 Jul 2015

    I tried following:

    public void actionPerformed() {
       view.statusBar.setText("Loading Content...");
       loadContent();
       setProgress(33);
    
       view.statusBar.setText("Adjusting Content...");
       adjustContent();
       setProgress(66);
    
       view.statusBar.setText("Saving Content...");
       saveContent();
       setProgress(100);
    }
    
    public void setProgress(int progress) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try { 
                    Thread.sleep(1000); 
                } catch (InterruptedException e) {}
                view.pb_settings.setValue(progress);
                view.pb_settings.repaint();
            }
        }).run();
    }
    


    So what happens now is, it does delay for 1s on each method call but does not update my jprogressbar. It just jumps aftere this 3 calls from 0 to 100, instead of setting value to 33, 66, and 100 to jprogressbar. How can I fix this ?

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Dice93 hasn't added any friends yet.

Comments

Dice93 has no profile comments yet. Why not say hello?