Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private int zustand = 1;
- public void ampel_WindowActivated(WindowEvent evt) {
- while (true) {
- zustand++;
- if (zustand > 4) {zustand=1;}
- switch (zustand) {
- case 1:
- panelRot.setVisible(true);
- panelGelb.setVisible(false);
- panelGruen.setVisible(false);
- break;
- case 2:
- panelRot.setVisible(true);
- panelGelb.setVisible(true);
- panelGruen.setVisible(false);
- break;
- case 3:
- panelRot.setVisible(false);
- panelGelb.setVisible(false);
- panelGruen.setVisible(true);
- break;
- case 4:
- panelRot.setVisible(false);
- panelGelb.setVisible(true);
- panelGruen.setVisible(false);
- break;
- }
- try{
- Thread.sleep(400);
- }
- catch (Exception e){
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement