grid and fractions

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

  1. bouki

    bouki New Member

    Joined:
    Apr 9, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    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?

    Code:
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice