Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Software to sequence diagram context Consider the following program code: //MyFrame.java import javax.swing.JButton; import javax.swing.JFrame; public class MyFrame extends JFrame { public JButton button;

1. Software to sequence diagram

context

Consider the following program code:

//MyFrame.java import javax.swing.JButton; import javax.swing.JFrame; public class MyFrame extends JFrame { public JButton button; public MyFrame() { this.setSize(250, 250); button = new JButton("Go"); button.setSize(100, 100); button.setActionCommand("Go"); this.add(button); this.setDefaultCloseOperation(EXIT_ON_CLOSE); } } //MyListener.java import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class MyListener implements ActionListener { public static void main(String[] args) { MyListener listener = new MyListener(); MyFrameframe = new MyFrame(); frame.button.addActionListener(listener); frame.setVisible(true); } @Override public void actionPerformed(ActionEvent e) { System.out.println(e.getActionCommand()); } }

Task:

How exactly does the interaction between the classes work when someone clicks the "Go" button?

a) Create a sequence diagram for the interaction between the two classes,

starting with the main method. Pay attention to the correct use of synchronous and

asynchronous messages.

b) Correct the "Play Game" sequence diagram from the Connect Four example.

Note: You are also allowed to run the code and examine it with an IDE.

the code again as img

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Support For Data Mining Applications Discovering Knowledge With Inductive Queries Lnai 2682

Authors: Rosa Meo ,Pier L. Lanzi ,Mika Klemettinen

2004th Edition

3540224793, 978-3540224792

More Books

Students also viewed these Databases questions

Question

How does theta affect the options premium? State an example.

Answered: 1 week ago