Hmmm… i thought what i had in update() method was supposed to take care of double-buffering. Anyways, its not really important, im not gonna use optionpanes in this project.
Ok, to elaborate on some of my code, here is a piece of it from actionPerformed(ActionEvent e):
else if(e.getSource()==b_quiz){
function=3; // this sets it to quiz mode
map_index=-1;
b_atlas.setVisible(false); b_quiz.setVisible(false); // this hides quiz and atlas buttons so that they dont show
loadAsia(); // this loads all the graphical stuff and flags of the continent
question_mode=1; // this mode is multiple choice question
newQuestion(question_mode); // this generates new question
hideAWT(false); // this shows all the components on the screen
positionAWT(); // this positions and resizes buttons and checkboxes
showComponents(question_mode); // this hides some of the components that are not needed.
}
This is a piece of code from showComponents() that sets visible those components that need to be shown. Notice that if mode=1, then the 4 checkboxes should be visible.
if(mode==1 || mode==4 || mode==6 || mode==9 || mode==11 || mode==13 || mode==16
|| mode==17){
checkbox1.setVisible(true); checkbox2.setVisible(true);
checkbox3.setVisible(true); checkbox4.setVisible(true);
textfield.setVisible(false);
}
Maybe those buttons that are named “submit” are never shown by java (same goes for the checkboxes). But then again, i tried renaming them and still doesnt work, so its not it. Maybe there is a limit on how many components you can have and maybe i have too many… :-\
If someone would just tell me that AWT stuff is very buggy, i will use my own components cause i wont have no other choice…