From 33310aef1681c9140de5f2167ca110a3bd8b742a Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 28 Mar 2008 22:38:22 +0000 Subject: [PATCH] board panel gets dimensions directly from KnightsTourBoard object git-svn-id: svn://anubis/gvsu@87 45c1a28c-8058-47b2-ae61-ca45b979098e --- cs621/proj4/KnightsTour.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cs621/proj4/KnightsTour.java b/cs621/proj4/KnightsTour.java index eddb512..4fc2308 100644 --- a/cs621/proj4/KnightsTour.java +++ b/cs621/proj4/KnightsTour.java @@ -79,13 +79,15 @@ public class KnightsTour extends JFrame }}, BorderLayout.NORTH); }}); - createBoardPanel(5, 5); + createBoardPanel(); setVisible(true); } - private void createBoardPanel(int width, int height) + private void createBoardPanel() { + int width = m_ktBoard.getWidth(); + int height = m_ktBoard.getHeight(); if (m_boardPanel != null) m_mainPanel.remove(m_boardPanel); m_boardPanel = new JPanel(new GridLayout(width, height));