I have a database with 3 columns:

Székszám // index of the chair/place in cinema
Terem (Index oF room),
Állapot (avaible or reserved)
If the állapot is available then set the icon of the label (with the same name of chair (example: A1) to green (zoldgomb.jpg),

// I know I should use icons instead of reading the same image multiple times. // it would be easier if I use arrays

The problem is: I tried it with equals, ==, and contains, but the result was false all the time (its good in sql). What should I use to compare the result (rs.next) with the name (or the text) of the labels?

Java Code:
         String sql="SELECT Székszám,Terem,Állapot FROM Teremszekek WHERE Terem='1' and Állapot like 'Szabad' ";
         String a1szov="A1";
         String a2szove="";
         String a3szov="";
         String b1szov="";
         String c1szov="";
         PreparedStatement pst = conn.prepareStatement(sql);
         ResultSet rs = pst.executeQuery();

        while (rs.next()) {
            a3szov=rs.getString("Székszám"); //A1

            a2szove=(A1.getText()).toString(); //A1's text A1



            if ((a3szov.equals(a2szove))){
            A1.setIcon(new ImageIcon("zoldgomb.jpg"));
            if ((a3szov.equals(b1szov))){
            B1.setIcon(new ImageIcon("zoldgomb.jpg"));
            if ((a3szov.equals(c1szov))){
            C1.setIcon(new ImageIcon("zoldgomb.jpg"));