Question: Creaate a JUnit test for this code in java swing import java.awt.*; import javax.swing.*; public class SquareMatrix extends JFrame { public SquareMatrix() { setLayout(new GridLayout(5,

Creaate a JUnit test for this code in java swing

import java.awt.*;

import javax.swing.*;

public class SquareMatrix extends JFrame { public SquareMatrix() {

setLayout(new GridLayout(5, 5));

for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) {

add(new JButton("Button " + i + " " + j));

} } }

public static void main(String[] args) {

SquareMatrix frame = new SquareMatrix();

frame.setTitle("SquareMatrix");

frame.setSize(400, 400);

frame.setLocationRelativeTo(null);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true);

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!