Java week 5 | Computer Science homework help

 

Assignment Instructions

Instructions:

* Make sure you go to this week’s chapter lesson for more guidance. 

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 W5_firstname_lastname.zip.

You must leave me a note in the Submitted Text area on how to compile and run your code.

Requirements

Points Available

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

Total

100