For this assignment, you will create a GUI with a push button event.  Use a JTextArea to display which button was selected. Save the code in jGRASP, then save it in c:myjava and run it. /******************* Name: Date: Notes: *******************/ import javax.swing.*; import java.awt.*; import java.awt.event.*; class Actions extends JFrame implements ActionListener { Create the components (textarea and buttons) public Actions() { create the window (include a close operation) create the container (include FlowLayout) add the event listeners (button.addActionListener) add the components } public void actionPerformed(ActionEvent event) { add the event handler( if statements and event.getSource should be used here) } public static void main (String[] args) { Actions eg = new Actions(); } } Make sure that you include all source codes and the compiled codes into You must leave me a note in the Submitted Text area on how to compile and run your code. Assignment details in a comment block (flowerbox) 10 Core application as described in the assignment requirement 60 Print function used to correctly to print the solution to the assignment 20 Code is commented and application name is submitted as requested 10 100

The assignment is to create a GUI with a push button event using Java. The program should display which button was selected in a JTextArea. The code should be saved in jGRASP, then saved in the specified directory and run.

The code provided is a skeleton for the assignment and needs to be completed. It starts with the import statements for the necessary libraries and defines the class “Actions” which extends JFrame and implements the ActionListener interface. The class also includes a constructor and the actionPerformed method.

To complete the assignment, we need to add the necessary code to create the components (JTextArea and buttons), create the window, create the container with a FlowLayout, add the event listeners using button.addActionListener, and add the components to the container.

In the actionPerformed method, we need to add the event handler code using if statements and the event.getSource method to determine which button was selected. The selected button should then be displayed in the JTextArea.

To compile and run the code, the following steps need to be followed:

1. Open the code in a Java development environment, such as jGRASP.
2. Save the code in the desired directory, for example, “c:myjava”.
3. Compile the code using the Java compiler. The exact command may vary depending on the environment, but it is typically something like “javac”.
4. Run the compiled code using the Java Virtual Machine. Again, the command may vary, but it could be “java Actions”.

In the submitted text area, provide instructions on how to compile and run the code, as well as any additional notes or comments.

The assignment will be evaluated based on the provided code and the completion of the required functionality. The core application should meet the requirements of the assignment, and the print function must be used correctly to display the solution. The code should be properly commented, and the application name must be submitted as requested in the assignment details.

The assignment is worth a total of 100 points, with the breakdown as follows:

– 10 points for the core application as described in the assignment requirement.
– 60 points for correctly using the print function to display the solution.
– 20 points for properly commenting the code and submitting the application name.
– 10 points for following all instructions and requirements.

Good luck with your assignment!

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.

Click Here to Make an Order Click Here to Hire a Writer