Her er lidt pseudo kode:
class GUI extends Frame {
private Progressbar bar;
public GUI() {
//......
bar = new Progressbar();
add(bar);
//...
}
void Compile_actionPerformed(ActionEvent e) {
DoYourWork.CompileNewMbe(MbeInp.getText(),
MbeOut.getText()
bar);
}
}
class EnEllerAndenKlasse {
void CompileNewMbe(String someText, String someOtherText, Progressbar bar) {
while(moreTextToParse) {
bar.setProgress(calculatedProgress);
//Do some work
}
}
}