1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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