Guest User

Untitled

a guest
Jul 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. class Kuuntelija implements ActionListener {
  2.  
  3. public void actionPerformed(ActionEvent e) {
  4. if (e.getSource() == Sikoban.this.lopetaAction) {
  5. System.exit(0);
  6. }
  7. if (e.getSource() == Sikoban.this.aloitaAlustaAction) {
  8. pelintila.setText(PELIKESKEN);
  9. Sikoban.this.getContentPane().remove(paapaneeli);
  10. try {
  11. Peliruudukko aloitaAlustaRuudukko = new Peliruudukko(Sikoban.this.tiedosto);
  12. Sikoban.this.paapaneeli = new Pelipaneeli(aloitaAlustaRuudukko);
  13. Sikoban.this.ruudukko = aloitaAlustaRuudukko;
  14. Sikoban.this.getContentPane().add(Sikoban.this.paapaneeli, BorderLayout.CENTER);
  15. Sikoban.this.setBackground(Color.DARK_GRAY);
  16. Sikoban.this.pack();
  17.  
  18. } catch (IllegalArgumentException e1) {
  19. e1.printStackTrace();
  20. } catch (FileNotFoundException e1) {
  21. e1.printStackTrace();
  22. }
  23. }
  24. if (e.getSource() == Sikoban.this.valitseKenttaAction) {
  25. try {
  26. main(null);
  27. } catch (FileNotFoundException e1) {
  28. System.out.println("Voit valita ainoastaan .txt tiedostoja");
  29. e1.printStackTrace();
  30. }
  31. }
  32. }
  33. }
Add Comment
Please, Sign In to add comment