private void OptionsActionPerformed(java.awt.event.ActionEvent evt)
{
// After clicking on button X, I want 4 other buttons to show up
// in a sequential order
ButtonTrue();
}
public void ButtonTrue()
{
Audio_Options.setVisible(true);
letsSleep();
Control_Options.setVisible(true);
letsSleep();
Display_Options.setVisible(true);
letsSleep();
Network_Options.setVisible(true);
}
public void letsSleep()
{
try {
Thread.sleep(10000);
} catch (InterruptedException ex) {
Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
}
}
我有 4 个按钮。我希望它们按顺序出现,例如:Button1 - 10seconds - Button2 - 10 seconds - Button3 - 10seconds - Button 4
问题:每当我调用函数“ButtonTrue()”时,它们都会在等待 30 秒后一起出现。什么会导致此问题发生?