// Project: Recursion // Module: knightstour // Source code file Main.java // Show solution of the Knights Tour Problem: // visit every square on an n x n chessboard once. // A knight makes an L-shaped move. import javax.swing.*; import java.awt.*; public class MyFrame extends JFrame { private MyPanel p; private int size; private String sizeString; public MyFrame() { super("Knights Tour Algorithm"); sizeString = JOptionPane. showInputDialog("Enter size"); size = Integer.parseInt(sizeString); p = new MyPanel(size); p.setLayout(new FlowLayout()); setContentPane(p); setSize(30*size+18, 30*size+40); setVisible(true); } }