Question: help i am trying to Modify my JFrameDisableButton2 program so that the JButton is not disabled until the user has clicked the button at least
help i am trying to Modify my JFrameDisableButton2 program so that the JButton is not disabled until the user has clicked the button at least eight times. After the user pressed the button 8 times display a JLabel that indicates Thats enough!. Save the file as JFrameDisableButton2.java. here is my program


import java.awt.event.*; import javax.swing.*; public class JFrameDisableButton2 extends JFrame implements ActionListener private JButton jbtn new JButton("Click Here"); private 3Label jlabel -new 3label("That's enough") private static int count # 0; public JFrameDisableButton2() setTitle("Disable Button"L setDefaultCloseOperation (3Frame.EXIT_ ON_CLOSE); add (jbtn); jbtn.addActionListener(this); public void actionPerformed (ActionEvent arg0) count++ if(count-8) jbtn.setVisible(false); jlabel.setVisible(true)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
