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.
Code :
private void testProgress(){
testProgressBar.setValue(question + 1);
}
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.
Re: Applets progress bar not increasing
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:
Code Java:
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:
Code :
<APPLET archive="narbutas.jar" code="org/me/test/test.class" width=575 height=525></APPLET>
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.
Re: Applets progress bar not increasing
Quote:
Originally Posted by
Edvinauskas
Here is the code that you are asking for:
Too much like hard work to go through the links posted, huh? Goodbye then.
db
Re: Applets progress bar not increasing
Hmm no, not too much work. I have been trying to correct the code, with the links provided.
Re: Applets progress bar not increasing
Quote:
Originally Posted by
Edvinauskas
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.
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. :o Thanks guys