Creaate a JUnit test for this code in java swing import java.awt.*; import javax.swing.*; public class SquareMatrix
Fantastic news! We've Found the answer you've been seeking!
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, 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);
}
Posted Date: