Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Kuuntelija implements ActionListener {
- public void actionPerformed(ActionEvent e) {
- if (e.getSource() == Sikoban.this.lopetaAction) {
- System.exit(0);
- }
- if (e.getSource() == Sikoban.this.aloitaAlustaAction) {
- pelintila.setText(PELIKESKEN);
- Sikoban.this.getContentPane().remove(paapaneeli);
- try {
- Peliruudukko aloitaAlustaRuudukko = new Peliruudukko(Sikoban.this.tiedosto);
- Sikoban.this.paapaneeli = new Pelipaneeli(aloitaAlustaRuudukko);
- Sikoban.this.ruudukko = aloitaAlustaRuudukko;
- Sikoban.this.getContentPane().add(Sikoban.this.paapaneeli, BorderLayout.CENTER);
- Sikoban.this.setBackground(Color.DARK_GRAY);
- Sikoban.this.pack();
- } catch (IllegalArgumentException e1) {
- e1.printStackTrace();
- } catch (FileNotFoundException e1) {
- e1.printStackTrace();
- }
- }
- if (e.getSource() == Sikoban.this.valitseKenttaAction) {
- try {
- main(null);
- } catch (FileNotFoundException e1) {
- System.out.println("Voit valita ainoastaan .txt tiedostoja");
- e1.printStackTrace();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment