Wywołanie konkretnego buttona

0

Witam, w javie jestem początkujący. Piszę grę planszową, mam 20 pól które są buttonami. Niestety nie wiem w jaki sposób wykonać przejście gracza na kolejne losowe pole (losowy button na planszy). Każdy button ma akcję kliknięcia, która ładuje informacje na temat danego pola. Niestety nie wiem jak dynamicznie wywoływać te buttony. Próbowałem operować nimi w tablicy, niestety pojawia się błąd
"AWT-EventQueue-0".

0

Pokaż jakiś kod, może uda się pomóc.

0

Klasa GUI:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package monopoly;


import javax.swing.JButton;

/**
 *
 * @author qb
 */


public class okno extends javax.swing.JFrame {

    /**
     * Creates new form okno
     */
     public static JButton[] button_tab = new JButton[18];
   
   
    
    public okno() {
        initComponents();

       
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        b0 = new javax.swing.JButton();
        b1 = new javax.swing.JButton();
        b2 = new javax.swing.JButton();
        b3 = new javax.swing.JButton();
        b4 = new javax.swing.JButton();
        b5 = new javax.swing.JButton();
        b8 = new javax.swing.JButton();
        b6 = new javax.swing.JButton();
        b7 = new javax.swing.JButton();
        b15 = new javax.swing.JButton();
        b14 = new javax.swing.JButton();
        b17 = new javax.swing.JButton();
        b16 = new javax.swing.JButton();
        b10 = new javax.swing.JButton();
        b9 = new javax.swing.JButton();
        b12 = new javax.swing.JButton();
        b11 = new javax.swing.JButton();
        b13 = new javax.swing.JButton();
        jTextField1 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jTextField4 = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextField5 = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jTextField6 = new javax.swing.JTextField();
        kup_pole = new javax.swing.JButton();
        kup_domek = new javax.swing.JButton();
        sprzedaj_domek = new javax.swing.JToggleButton();
        sprzedaj_pole = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jTextField7 = new javax.swing.JTextField();
        koniec_kolejki = new javax.swing.JButton();
        rezygnacja = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        ruch_button = new javax.swing.JButton();
        ile_domkow = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Monopoly_jd");
        setFocusableWindowState(false);
        setMinimumSize(new java.awt.Dimension(798, 550));
        getContentPane().setLayout(null);

        b0.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\start.jpg")); // NOI18N
        b0.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                b0ActionPerformed(evt);
            }
        });
        getContentPane().add(b0);
        b0.setBounds(10, 20, 90, 90);
        b0.getAccessibleContext().setAccessibleName("0");

        b1.setBackground(new java.awt.Color(255, 0, 0));
        b1.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\londyn_1.jpg")); // NOI18N
        b1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                b1ActionPerformed(evt);
            }
        });
        getContentPane().add(b1);
        b1.setBounds(106, 20, 90, 90);

        b2.setBackground(new java.awt.Color(255, 0, 0));
        b2.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\bristol_1.jpg")); // NOI18N
        getContentPane().add(b2);
        b2.setBounds(202, 20, 90, 90);

        b3.setBackground(new java.awt.Color(0, 153, 255));
        b3.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\berlin_2.jpg")); // NOI18N
        getContentPane().add(b3);
        b3.setBounds(298, 20, 90, 90);

        b4.setBackground(new java.awt.Color(0, 153, 255));
        b4.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\drezno_2.jpg")); // NOI18N
        getContentPane().add(b4);
        b4.setBounds(394, 20, 90, 90);

        b5.setBackground(new java.awt.Color(0, 204, 204));
        b5.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\wroclaw_3.jpg")); // NOI18N
        getContentPane().add(b5);
        b5.setBounds(490, 20, 90, 90);

        b8.setBackground(new java.awt.Color(51, 255, 0));
        b8.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\genewa_4.jpg")); // NOI18N
        getContentPane().add(b8);
        b8.setBounds(490, 308, 90, 90);

        b6.setBackground(new java.awt.Color(0, 204, 204));
        b6.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\warszawa_3.jpg")); // NOI18N
        getContentPane().add(b6);
        b6.setBounds(490, 116, 90, 90);

        b7.setBackground(new java.awt.Color(51, 255, 0));
        b7.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\paryz_4.jpg")); // NOI18N
        getContentPane().add(b7);
        b7.setBounds(490, 212, 90, 90);

        b15.setBackground(new java.awt.Color(102, 102, 0));
        b15.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\neapol_7.jpg")); // NOI18N
        getContentPane().add(b15);
        b15.setBounds(10, 308, 90, 90);

        b14.setBackground(new java.awt.Color(102, 102, 0));
        b14.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\rzym_7.jpg")); // NOI18N
        getContentPane().add(b14);
        b14.setBounds(10, 404, 90, 90);

        b17.setBackground(new java.awt.Color(153, 153, 153));
        b17.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\porto_8.jpg")); // NOI18N
        getContentPane().add(b17);
        b17.setBounds(10, 116, 90, 90);

        b16.setBackground(new java.awt.Color(153, 153, 153));
        b16.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\lizbona_8.jpg")); // NOI18N
        getContentPane().add(b16);
        b16.setBounds(10, 212, 90, 90);

        b10.setBackground(new java.awt.Color(255, 255, 0));
        b10.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\barcelona_5.jpg")); // NOI18N
        getContentPane().add(b10);
        b10.setBounds(394, 404, 90, 90);

        b9.setBackground(new java.awt.Color(255, 255, 0));
        b9.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\sevilla_5.jpg")); // NOI18N
        b9.setToolTipText("");
        getContentPane().add(b9);
        b9.setBounds(490, 404, 90, 90);

        b12.setBackground(new java.awt.Color(255, 102, 0));
        b12.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\brno_6.jpg")); // NOI18N
        getContentPane().add(b12);
        b12.setBounds(202, 404, 90, 90);

        b11.setBackground(new java.awt.Color(255, 255, 0));
        b11.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\madryt_5.jpg")); // NOI18N
        getContentPane().add(b11);
        b11.setBounds(298, 404, 90, 90);

        b13.setBackground(new java.awt.Color(255, 102, 0));
        b13.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\praga_6.jpg")); // NOI18N
        getContentPane().add(b13);
        b13.setBounds(106, 404, 90, 90);

        jTextField1.setToolTipText("");
        jTextField1.setEnabled(false);
        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });
        getContentPane().add(jTextField1);
        jTextField1.setBounds(676, 106, 71, 20);

        jLabel1.setText("Nazwa:");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(595, 110, 80, 14);

        jTextField2.setEnabled(false);
        getContentPane().add(jTextField2);
        jTextField2.setBounds(676, 150, 71, 20);

        jLabel2.setText("Cena:");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(595, 150, 80, 14);

        jTextField3.setEnabled(false);
        getContentPane().add(jTextField3);
        jTextField3.setBounds(676, 172, 71, 20);

        jLabel3.setText("Cena domu:");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(595, 171, 80, 14);

        jTextField4.setEnabled(false);
        getContentPane().add(jTextField4);
        jTextField4.setBounds(676, 194, 71, 20);

        jLabel4.setText("Właściciel:");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(595, 197, 80, 14);

        jTextField5.setToolTipText("");
        jTextField5.setEnabled(false);
        getContentPane().add(jTextField5);
        jTextField5.setBounds(690, 10, 90, 20);

        jLabel5.setText("Nazwa gracza:");
        getContentPane().add(jLabel5);
        jLabel5.setBounds(595, 10, 90, 14);

        jLabel6.setText("Kapitał:");
        getContentPane().add(jLabel6);
        jLabel6.setBounds(595, 40, 71, 14);

        jTextField6.setToolTipText("");
        jTextField6.setEnabled(false);
        jTextField6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField6ActionPerformed(evt);
            }
        });
        getContentPane().add(jTextField6);
        jTextField6.setBounds(690, 40, 90, 20);

        kup_pole.setText("Kup miejscowość");
        kup_pole.setToolTipText("");
        getContentPane().add(kup_pole);
        kup_pole.setBounds(600, 280, 173, 23);

        kup_domek.setText("Kup domek");
        kup_domek.setToolTipText("");
        getContentPane().add(kup_domek);
        kup_domek.setBounds(600, 310, 173, 23);

        sprzedaj_domek.setText("Sprzedaj domek");
        getContentPane().add(sprzedaj_domek);
        sprzedaj_domek.setBounds(600, 340, 173, 23);

        sprzedaj_pole.setText("Sprzedaj miejscowość");
        getContentPane().add(sprzedaj_pole);
        sprzedaj_pole.setBounds(600, 370, 173, 23);

        jLabel7.setText("Opłata:");
        getContentPane().add(jLabel7);
        jLabel7.setBounds(595, 219, 80, 14);

        jTextField7.setEnabled(false);
        getContentPane().add(jTextField7);
        jTextField7.setBounds(676, 216, 71, 20);

        koniec_kolejki.setText("Zakończ kolejkę");
        getContentPane().add(koniec_kolejki);
        koniec_kolejki.setBounds(600, 420, 170, 23);

        rezygnacja.setText("Poddaj się");
        getContentPane().add(rezygnacja);
        rezygnacja.setBounds(600, 450, 170, 23);

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        jLabel8.setIcon(new javax.swing.ImageIcon("C:\\Users\\qb\\Desktop\\monopolly\\tlo.png")); // NOI18N
        jLabel8.setText("jLabel8");
        getContentPane().add(jLabel8);
        jLabel8.setBounds(0, 0, 590, 510);

        ruch_button.setText("Ruch");
        ruch_button.setMaximumSize(new java.awt.Dimension(113, 23));
        ruch_button.setMinimumSize(new java.awt.Dimension(113, 23));
        ruch_button.setPreferredSize(new java.awt.Dimension(113, 23));
        ruch_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ruch_buttonActionPerformed(evt);
            }
        });
        getContentPane().add(ruch_button);
        ruch_button.setBounds(600, 250, 173, 23);

        ile_domkow.setEnabled(false);
        getContentPane().add(ile_domkow);
        ile_domkow.setBounds(676, 128, 71, 20);

        jLabel9.setText("Ilość domków:");
        getContentPane().add(jLabel9);
        jLabel9.setBounds(595, 130, 70, 14);

        pack();
    }// </editor-fold>                        

    
    private void b0ActionPerformed(java.awt.event.ActionEvent evt) {                                   
        // TODO add your handling code here:
       
    }                                  

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {                                            
        // TODO add your handling code here:
    }                                           

    private void b1ActionPerformed(java.awt.event.ActionEvent evt) {                                   
            Monopoly.zmiana_pola(1); 
           
            
            
    }                                  

    private void jTextField6ActionPerformed(java.awt.event.ActionEvent evt) {                                            
        // TODO add your handling code here:
    }                                           

    private void ruch_buttonActionPerformed(java.awt.event.ActionEvent evt) {                                            

        
        
        
        
        // TODO add your handling code here:
    }                                           

    /**
     * @param args the command line arguments
     * 
     */
    

    
    
    
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(okno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(okno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(okno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(okno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new okno().setVisible(true);
                
            }
        });
    }
    // Variables declaration - do not modify                     
    public static javax.swing.JButton b0;
    public static javax.swing.JButton b1;
    public static javax.swing.JButton b10;
    public static javax.swing.JButton b11;
    public static javax.swing.JButton b12;
    public static javax.swing.JButton b13;
    public static javax.swing.JButton b14;
    public static javax.swing.JButton b15;
    public static javax.swing.JButton b16;
    public static javax.swing.JButton b17;
    public static javax.swing.JButton b2;
    public static javax.swing.JButton b3;
    public static javax.swing.JButton b4;
    public static javax.swing.JButton b5;
    public static javax.swing.JButton b6;
    public static javax.swing.JButton b7;
    public static javax.swing.JButton b8;
    public static javax.swing.JButton b9;
    public javax.swing.JTextField ile_domkow;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    public javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    public javax.swing.JTextField jTextField1;
    public javax.swing.JTextField jTextField2;
    public javax.swing.JTextField jTextField3;
    public javax.swing.JTextField jTextField4;
    public javax.swing.JTextField jTextField5;
    public javax.swing.JTextField jTextField6;
    public javax.swing.JTextField jTextField7;
    public javax.swing.JButton koniec_kolejki;
    public javax.swing.JButton kup_domek;
    public javax.swing.JButton kup_pole;
    public javax.swing.JButton rezygnacja;
    public javax.swing.JButton ruch_button;
    public javax.swing.JToggleButton sprzedaj_domek;
    public javax.swing.JButton sprzedaj_pole;
    // End of variables declaration                   
}

Następnie klasa gry:


/*i
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package monopoly;
import java.awt.Color;
import java.util.ArrayList;
import javax.swing.JOptionPane;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JButton;

/**
 *
 * @author qb
 */
public class Monopoly {
    
    static okno window = new okno();
    static ArrayList<Pole> lista_pol = new ArrayList<Pole>();
    

    /**
     * @param args the command line arguments
     */
    
    
    
    
    public static void zmiana_pola( int numer_pola)
    {       
        window.jTextField1.setText(lista_pol.get(numer_pola).nazwa);         
        window.jTextField2.setText(Integer.toString(lista_pol.get(numer_pola).cena));
        window.jTextField3.setText(Integer.toString(lista_pol.get(numer_pola).cena_domu));
        window.jTextField4.setText(lista_pol.get(numer_pola).wlasciciel);
        window.jTextField7.setText(Integer.toString(lista_pol.get(numer_pola).oplata));
        window.ile_domkow.setText(Integer.toString(lista_pol.get(numer_pola).ilosc_domow));
        window.b1.setBorder(BorderFactory.createTitledBorder("Gracz 1")); 
    }

    public static void main(String[] args) {
 
        window.setVisible(true);
        window.jTextField1.enable(false);
        //window.setResizable(false);

        Pole pozycja = new Pole();
  
        pozycja.id=0;
        pozycja.nazwa="Start";      
        lista_pol.add(0,pozycja);
 
       lista_pol.add(1,pozycja);
       lista_pol.get(1).nazwa = "Londyn";
       lista_pol.get(1).id=1;
       
       
       lista_pol.add(2,pozycja);
       lista_pol.get(2).nazwa = "Bristol";
       
       
       lista_pol.add(3,pozycja);
       lista_pol.get(3).nazwa = "Berlin";
       
       lista_pol.add(4,pozycja);
       lista_pol.get(4).nazwa = "Drezno";
       
       lista_pol.add(5,pozycja);
       lista_pol.get(5).nazwa = "Wrocław";
       
       lista_pol.add(6,pozycja);
       lista_pol.get(6).nazwa = "Warszawa";
       
       lista_pol.add(7,pozycja);
       lista_pol.get(7).nazwa = "Paryż";
       
       lista_pol.add(8,pozycja);
       lista_pol.get(8).nazwa = "Genewa";
       
       lista_pol.add(9,pozycja);
       lista_pol.get(9).nazwa = "Sevilla";
       
       lista_pol.add(10,pozycja);
       lista_pol.get(10).nazwa = "Barcelona";
       
       lista_pol.add(11,pozycja);
       lista_pol.get(11).nazwa = "Madryt";
       
       lista_pol.add(12,pozycja);
       lista_pol.get(12).nazwa = "Brno";
       
       lista_pol.add(13,pozycja);
       lista_pol.get(13).nazwa = "Praga";
       
       lista_pol.add(14,pozycja);
       lista_pol.get(14).nazwa = "Rzym";
       
       lista_pol.add(15,pozycja);
       lista_pol.get(15).nazwa = "Neapol";
       
       lista_pol.add(16,pozycja);
       lista_pol.get(16).nazwa = "Lizbona";
       
       lista_pol.add(17,pozycja);
       lista_pol.get(17).nazwa = "Porto";

        // TODO code application logic here
    }
}

Z każdą pozycją z listy lista_pol chcę powiązać buttona, tak aby wywołać button zgodny z numerem pozycji. Próbowałem z tablicą buttonów, niestety wywala błąd (post początkowy).

W metodzie zmiana_pola chciałbym wywoływać button po numerze

window.tablica_przyciskow[numer_pola].setBorder(BorderFactory.createTitledBorder("Gracz 1"));
0

Problem obszedłem po linii najmniejszego oporu, jednak dalej szukam sposobu czy nie da się tego zrobić w kilku linijkach kodu.

    public static void zmiana_pola( int numer_pola)
    {       
        window.jTextField1.setText(lista_pol.get(numer_pola).nazwa);         
        window.jTextField2.setText(Integer.toString(lista_pol.get(numer_pola).cena));
        window.jTextField3.setText(Integer.toString(lista_pol.get(numer_pola).cena_domu));
        window.jTextField4.setText(lista_pol.get(numer_pola).wlasciciel);
        window.jTextField7.setText(Integer.toString(lista_pol.get(numer_pola).oplata));
        window.ile_domkow.setText(Integer.toString(lista_pol.get(numer_pola).ilosc_domow));
        
        
        if (numer_pola == 0)
        {
        window.b0.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 1)
        {
        window.b1.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 2)
        {
        window.b2.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 3)
        {
        window.b3.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 4)
        {
        window.b4.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 5)
        {
        window.b5.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 6)
        {
        window.b6.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 7)
        {
        window.b7.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 8)
        {
        window.b8.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 9)
        {
        window.b9.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 10)
        {
        window.b10.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 11)
        {
        window.b11.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 12)
        {
        window.b12.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 13)
        {
        window.b13.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 14)
        {
        window.b14.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 15)
        {
        window.b15.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 16)
        {
        window.b16.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }else
        if (numer_pola == 17)
        {
        window.b17.setBorder(BorderFactory.createTitledBorder("Gracz 1"));
        }

1 użytkowników online, w tym zalogowanych: 0, gości: 1