Need some help regarding my code. Button btnMin not functioning well. When I try to click btnFill then btnMin, the button works fine, but when I try to click the four buttons consecutively, btnMin failed to work. Hope you can help me.

Code:
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.util.*;  

public class array extends Applet implements ActionListener
{
    Button btnFill = new Button("Fill Array");
    Button btnSort = new Button("Sort");
    Button btnMax = new Button("Find Maximum");
    Button btnMin = new Button("Find Minimum");
    TextArea Display = new TextArea(10,20);
    Label lblMaxMin = new Label("##################");
    int[] myArray = new int[5];
    int x;
    String strOutput = "";

public void init()
{
    Panel pnl1 = new Panel();
    Panel pnl2 = new Panel();
    Panel pnl3 = new Panel();

    pnl1.setLayout(new GridLayout(4,0));
    pnl1.add(btnFill);    btnFill.addActionListener(this);
    pnl1.add(btnSort);    btnSort.addActionListener(this);
    pnl1.add(btnMax);    btnMax.addActionListener(this);
    pnl1.add(btnMin);    btnMin.addActionListener(this);

    pnl2.setLayout(new GridLayout(1,1));
    pnl2.add(Display);

    pnl3.setLayout(new GridLayout(6,0));
    pnl3.add(lblMaxMin);
    add(pnl1);
    add(pnl2);
    add(pnl3);
}

public void actionPerformed(ActionEvent a)
{
    Object Obj = a.getSource();

    if(Obj == btnFill)
    {
      Display.setText("");
      for(int x=0; x<myArray.length; x++)
      {
        myArray[x] = (int)(Math.random()*100)+1;
        Display.append("[" + (x+1) + "]" + "   " + myArray[x] + "\n");
      }
    }

    else if(Obj == btnSort)
    {
      Display.setText("");
      Arrays.sort(myArray);
      for(int x=0; x<myArray.length; x++)
      {
        Display.append("[" + (x+1) + "]" + "   " + myArray[x] + "\n");
      }
    }

    else if(Obj == btnMax)
    {
      lblMaxMin.setText("");
      int max = myArray[0];
      for(int x=0; x<myArray.length; x++)
      {
        if(myArray[x] > max)
        {
        max = myArray[x];
        lblMaxMin.setText("Maximum Number =" + max);
        }
      }
    }

    else
    {
      lblMaxMin.setText("");
      int min = myArray[0];
      for(int x=0; x<myArray.length; x++)
      {
        if(myArray[x] < min)
        {
        min = myArray[x];
        lblMaxMin.setText("Minimum Number =" + min);
        }
      }
    }
}
}