Hello everyone. I am in need of a few extra minds in order to understand what is wrong with my program. It's purpose is to represent a crossline game. So I have two classes.
The first one(MyfirstGUI which works fine I guess since all the the graphics are there). The second one thought (Triliza) doesnt. It's main purpose is to take two numbers as input(I am talking about the Insert method) which stand for the array's dimensions. Before I insert anything I initialize the array so all it's content is set to -1 value. After inserting two Integers for example 0 and 1 the method goes to the array and checks if that spot is free(equals to -1). If it is then it just inserts the number and then checks if there is a winning case(If the near blocks have the same value). If that's true (We have a winning case) then it makes status=1 and then message=2. The message variable is there so I can understand which warning message I should display. I have two of them. One is for when the user tries to pick a block which already hosts a value and the other one is for declaring a winner. The problem is that the second message doesnt work at all. Here is the code:

Code:
package myfirstgui;

import java.awt.*;
import java.awt.event.*;
import java.util.Scanner;
import javax.swing.*;
        
public class MyfirstGUI extends JFrame implements ActionListener {

    /**
     * @param args the command line arguments
     */
    JButton[] k= new JButton[9];
     JTextField[] l= new JTextField[9];

    Triliza oti= new Triliza();
    
   
    
    public MyfirstGUI(String title)
    {
        
        super(title);
        oti.Init();
        setSize(500,500);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLayout(new GridLayout(8,2));
        for(int i=0;i<9;i++)
        {
           
                l[i]=new JTextField();
                add(l[i]);
                
            
        }
        for(int i=0;i<9;i++)
        {
            
                k[i]=new JButton(""+i);
                k[i].addActionListener(this);
                add(k[i]);
                
            
        }
    
         
   
    }
    public void actionPerformed(ActionEvent e)
    {
        if(e.getSource()==k[0])
        {
            if(oti.Insert(0,0)==1)
            {
                JOptionPane.showMessageDialog(this, "There is already an element in that place", "Element position", JOptionPane.ERROR_MESSAGE);
              
            }
            else if(oti.Insert(0,0)==2)
            {
                JOptionPane.showMessageDialog(null, "We have a winner", "WINNER", JOptionPane.ERROR_MESSAGE);
            }
            else
            {
                oti.Insert(0,0);
                l[0].setText("X");
            }
        }
        if(e.getSource()==k[1])
        {
            if(oti.Insert(0,1)==1)
            {
                JOptionPane.showMessageDialog(null, "There is already an element in that place", "Element position", JOptionPane.ERROR_MESSAGE);
            }
            else if(oti.Insert(0,1)==2)
            {
                JOptionPane.showMessageDialog(null, "We have a winner", "WINNER", JOptionPane.ERROR_MESSAGE);
            }
            else
            {
                oti.Insert(0,1);
                l[1].setText("X");
            }
        }
        if(e.getSource()==k[2])
        {
            if(oti.Insert(0,2)==1)
            {
                JOptionPane.showMessageDialog(null, "There is already an element in that place", "Element position", JOptionPane.ERROR_MESSAGE);
            }
            else if(oti.Insert(0,2)==2)
            {
                JOptionPane.showMessageDialog(null, "We have a winner", "WINNER", JOptionPane.ERROR_MESSAGE);
            }
            else
            {
                oti.Insert(0,2);
                l[2].setText("X");
            }
        }
        if(e.getSource()==k[3])
        {
            if(oti.Insert(1,0)==1)
            {
                JOptionPane.showMessageDialog(null, "There is already an element in that place", "Element position", JOptionPane.ERROR_MESSAGE);
            }
            else if(oti.Insert(1,0)==2)
            {
                JOptionPane.showMessageDialog(null, "We have a winner", "WINNER", JOptionPane.ERROR_MESSAGE);
            }
            else
            {
                oti.Insert(1, 0);
                l[3].setText("X");
            }
        }
        if(e.getSource()==k[4])
        {
            if(oti.Insert(1,1)==1)
            {
                JOptionPane.showMessageDialog(null, "There is already an element in that place", "Element position", JOptionPane.ERROR_MESSAGE);
            }
            else if(oti.Insert(1,1)==2)
            {
                JOptionPane.showMessageDialog(null, "We have a winner", "WINNER", JOptionPane.ERROR_MESSAGE);
            }
            else
            {
                oti.Insert(1,1);
                l[4].setText("X");
            }
        }
        if(e.getSource()==k[5])
        {
            if(oti.Insert(1,2)==1)
            {
                JOptionPane.showMessageDialog(null, "There is already an element in that place", "Element position", JOptionPane.ERROR_MESSAGE);
            }
            else if(oti.Insert(1,2)==2)
            {
                JOptionPane.showMessageDialog(null, "We have a winner", "WINNER", JOptionPane.ERROR_MESSAGE);
            }
            else
            {
                oti.Insert(1,2);
                l[5].setText("X");
            }
        }
        if(e.getSource()==k[6])
        {
            if(oti.Insert(2,0)==1)
            {
                JOptionPane.showMessageDialog(null, "There is already an element in that place", "Element position", JOptionPane.ERROR_MESSAGE);
            }
            else if(oti.Insert(2,0)==2)
            {
                JOptionPane.showMessageDialog(null, "We have a winner", "WINNER", JOptionPane.ERROR_MESSAGE);
            }
            else
            {
                oti.Insert(2,0);
                l[6].setText("X");
                
            }
           
        }
        if(e.getSource()==k[7])
        {
            if(oti.Insert(2,1)==1)
            {
                JOptionPane.showMessageDialog(null, "There is already an element in that place", "Element position", JOptionPane.ERROR_MESSAGE);
            }
            else if(oti.Insert(2,1)==2)
            {
                JOptionPane.showMessageDialog(null, "We have a winner", "WINNER", JOptionPane.ERROR_MESSAGE);
            }
            else
            {
                oti.Insert(2, 1);
                l[7].setText("X");
                
            }
        }
        if(e.getSource()==k[8])
        {
            if(oti.Insert(2,2)==1)
            {
                JOptionPane.showMessageDialog(null, "There is already an element in that place", "Element position", JOptionPane.ERROR_MESSAGE);
                
            }
            else if(oti.Insert(2,2)==2)
            {
                JOptionPane.showMessageDialog(null, "We have a winner", "WINNER", JOptionPane.ERROR_MESSAGE);
            }
            else
            {
                oti.Insert(2,2);
                l[8].setText("X");
                
            }
        }
    }
    public static void main(String[] args) {
        MyfirstGUI y= new MyfirstGUI("First");
        y.setVisible(true);
        
    }
}
Code:
package myfirstgui;

/**
 *
 * @author Константин
 */
import java.awt.*;
import java.awt.event.*;
import java.util.Scanner;
import javax.swing.*;
public class Triliza {
    int[][] array= new int[3][3];
    int status=0;
    int message=0;
    int turns=0;
    int z;
    public void Init()
    {
        for(int i=0;i<3;i++)
        {
            for(int j=0;j<3;j++)
            {
                array[i][j]=-1;
            }
        }
    }
    public int Insert(int x, int y)
    {
        if(turns%2==0)
        {
            z=0;
        }
        else
        {
            z=1;
        }
        if(array[x][y]!=-1)
        {
            message=1;
            turns++;
            
           int k=message;
            message=0; 
            return 1; 
            
        }
        else
        {
            array[x][y]=z;
        if(x==0 && y==0)
        {
            if ((array[0][1]==z && array[0][2]==z) || (array[1][0]==z && array[2][0]==z) || (array[1][1]==z && array[2][2]==z))
            {
                status=1;
                
            }
        }
        if(x==0 && y==1)
        {
            if((array[0][0]==z && array[0][2]==z) || (array[1][1]==z && array[2][1]==z))
            {
                status=1;
            }
        }
        if(x==0 && y==2)
        {
            if((array[0][0]== z && array[0][1]==z) || (array[1][1]==z && array[2][0]==z))
                    {
                        status=1;
                      
                    }
        }
        if(x==1 && y==0)
        {
            if((array[0][0]==z && array[2][0]==z) || (array[1][1]==z && array[1][2]==z))
            {
                status=1;
            }
        }
        if(x==1 && y==1)
        {
            if((array[1][0]==z && array[1][2]==z) || (array[0][1]==z && array[2][1]==z) || (array[0][0]==z && array[2][2]==z) ||(array[0][2]==z && array[2][0]==z))
            {
                status=1;
            }
        }
        if(x==1 && y==2)
        {
            if((array[0][2]==z && array[2][2]==z) || (array[1][0]==z || array[1][1]==z) )
            {
                status=1;
            }   
        }
        if(x==2 && y==0)
        {
            if((array[2][1]==z && array[2][2]==z) || (array[0][0]==z && array[1][0]==z ) || (array[1][1]==z && array[0][2]==z))
            {
                status=1;
            }
        }
        if(x==2 && y==1)
        {
            if((array[2][0]==z && array[2][2]==z) || (array[0][1]==z && array[1][1]==z))
            {
                status=1;
            }
        }
        if(x==2 && y==2)
        {
            
            if((array[2][0]==z && array[2][1]==z)|| (array[0][2]==z && array[1][2]==z) || (array[0][0]==z && array[1][1]==z))
            {
                status=1;
            }
        }
        }
        if(status==1)
        {
            message=2;
           // turns=0;
           
          // return message;
           
        }
        turns++;
        return message;
    }
}