Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 9 of 9

Thread: Applets progress bar not increasing

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Applets progress bar not increasing

    Hey, ive made a simple test applet for a project. But when i start the applet up and start the test the progress bar doesn't progress. 3 questions, 100% is set to 3 for the progress bar, and i increment the progress by one every time a person clicks next. But the Progress bar doesn't increase. When the test is finished the progress jumps to 100%.

    When the next button is pressed i call this function.

       private void testProgress(){
            testProgressBar.setValue(question + 1);
        }


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,166
    My Mood
    Hungover
    Thanks
    141
    Thanked 597 Times in 512 Posts

    Default Re: Applets progress bar not increasing

    If you want help, you'll have to provide an SSCCE that demonstrates the problem. Otherwise we're just guessing at what your code is doing.

  3. #3
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    489
    Thanks
    8
    Thanked 45 Times in 43 Posts

  4. #4
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Applets progress bar not increasing

    I i think i left out the most important part, when i run the applet in "applet viewer" (with netbeans) the progress bar is ok. Increases the value every time the next question button is pressed. But when i put the new build .jar file into a web server the progress isnt shown. Here is the code that you are asking for:

    private void nextQuestionActionPerformed(java.awt.event.ActionEvent evt) {                                                  
            if(radioButtonGroup.getSelection() == null){
                JOptionPane.showMessageDialog(rootPane, "Please choose an answer!", "Answer not selected", 
    JOptionPane.ERROR_MESSAGE);
            } else {
                getMarkedAnswer();
                radioButtonGroup.clearSelection();
                question += 1;
                testProgress();
                newQuestion();
           }        
    }    
     
    ........
     
      private void testProgress(){
            testProgressBar.setValue(question);
        }

    Tried to change the code a little bit but i gt the same result. The set value i got from the Java link provided by Darryl.Burke, when i was originally writing the applet.

    heres the HTML code used to run the applet:

    <APPLET archive="narbutas.jar" code="org/me/test/test.class" width=575 height=525></APPLET>
    Last edited by Edvinauskas; November 19th, 2010 at 07:06 PM.

  5. #5
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,234
    Thanks
    176
    Thanked 817 Times in 760 Posts
    Blog Entries
    5

    Default Re: Applets progress bar not increasing

    It could be throwing an exception during the process and not even reach the progress bar update. This may not occur in BrowserViewer if that exception is a SecurityException, so is there anything amongst all those functions that might perhaps require the jar to be signed? See Understanding Signing.You could test this by commenting out the other calls and just have the progress update. If it works, incrementally add back those functions to narrow down the code.

  6. #6
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    489
    Thanks
    8
    Thanked 45 Times in 43 Posts

    Default Re: Applets progress bar not increasing

    Quote Originally Posted by Edvinauskas View Post
    Here is the code that you are asking for:
    Too much like hard work to go through the links posted, huh? Goodbye then.

    db

  7. #7
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Applets progress bar not increasing

    Hmm no, not too much work. I have been trying to correct the code, with the links provided.

  8. #8
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,166
    My Mood
    Hungover
    Thanks
    141
    Thanked 597 Times in 512 Posts

    Default Re: Applets progress bar not increasing

    Quote Originally Posted by Edvinauskas View Post
    Hmm no, not too much work. I have been trying to correct the code, with the links provided.
    Then where's that SSCCE? Posting an incomplete piece of code doesn't really help us much, I'm afraid.

  9. #9
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Applets progress bar not increasing

    I got it corrected, thanks for the links they did help. I guess now i just need to improve on making my posts more clear. Thanks guys

Similar Threads

  1. Applets
    By santiagomez in forum Java Theory & Questions
    Replies: 2
    Last Post: July 31st, 2010, 04:05 PM
  2. Help needed with applets
    By Brt93yoda in forum What's Wrong With My Code?
    Replies: 16
    Last Post: July 12th, 2010, 07:36 PM
  3. [Swing-Progress Bar] Can't resize progress bar
    By Grabar in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 14th, 2010, 12:27 PM
  4. increasing my java knowledge
    By doogiexiv in forum Java Theory & Questions
    Replies: 1
    Last Post: March 8th, 2010, 10:00 PM
  5. Increasing performance of my graphics routines
    By willberg in forum AWT / Java Swing
    Replies: 6
    Last Post: November 16th, 2009, 12:41 PM