1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

grid and fractions

Discussion in 'Java' started by bouki, Mar 1, 2012.

  1. bouki

    bouki New Member

    Apr 9, 2010
    Likes Received:
    Trophy Points:
    I have created a 3*3 grid using buttons but i want to hide the items that is stored in the buttons and have the user click on a button to reveal a fraction. If the user find two match then the program tally a score.

    How do i implement this?

    class RayFractions extends JFrame implements ActionListener, ItemListener {
       JButton one = new JButton.("1/2");
       JButton two = new JButton("2/4");
       JButton three = new JButton("3/9");
       JButton four = new JButton("4/8");
       JButton five = new JButton("5/6");
       JButton six = new JButton("6/9");
       JButton seven = new JButton("7/5");
       JButton eight = new JButton("8/8");
       JButton nine = new JButton("4/9");

Share This Page