2A

Build a Java application that allows a user to click on two buttons, namely UP and DOWN. When a user clicks on the UP button, the Java program will increase the value of an integer counter by 5. When a user clicks on the DOWN button, the program will decrease the value of an integer counter by 5. The program will always display the current value of the integer counter after a button is clicked.

  • You must code a Java class called TwoButtonsApp that is a subclass of JFrame. You only need to provide
    • the declarations of all instance variables, and
    • a constructor that takes one integer argument.
  • The constructor will use the integer argument as the starting value of an integer counter. It also creates and registers listener(s) for the two buttons. You are not required to provide any code that is related to the layout of the GUI.
  • You must code one or two Java classes that handle the events whenever the buttons are clicked. The event handler(s) will use a JLabel object to display the value of an integer counter. It is assumed that the event handling classes are inner classes. (Note: You can call the setText method to change the contents of a JLabel object.)

2B

You are asked to build a Java application that allows a user to click on two buttons, namely INCR and DECR. When a user clicks on the INCRR button, the Java program will increase the value of an integer counter by 10. When a user clicks on the DECR button, the program will decrease the value of an integer counter by 10. The program will always display the current value of the integer counter after a button is clicked.

  • You must code a Java class called PlayButtonsApp that is a subclass of JFrame. You only need to provide
    • ) the declarations of all instance variables, and
    • a constructor that takes one integer argument.
  • The constructor will use the integer argument as the starting value of an integer counter. It also creates and registers listener(s) for the two buttons. You are not required to provide any code that is related to the layout of the GUI.
  • You must code one or two Java classes that handle the events whenever the buttons are clicked. The event handler(s) will use a JLabel object to display the value of an integer counter. It is assumed that the event handling classes are inner classes. (Note: You can call the setText method to change the contents of a JLabel object.)
Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.