Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package csc143.sudoku;
- import javax.swing.*;
- import java.awt.*;
- /**
- * @author Vita Wiebe
- * @version PA2
- * A helper class to make a cell inside a SudokuBoard object.
- */
- public class Cell extends JPanel {
- /** Our class constructor.
- * Determines size and shape of Cell object, which has
- * been standardized for the purposes of this assignment.
- * @param int row, int column, used to keep board position.
- */
- public Cell(int row, int column) {
- setPreferredSize(new Dimension(50, 50));
- //add(new JLabel(column + ", " + row));
- setOpaque(false);
- setEnabled(true);
- }
- /**
- * This method renders one 50x50 "cell" to add to cell array "cells".
- * @param g The Graphics object use to render
- */
- @Override
- public void paintComponent(java.awt.Graphics g) {
- // paint the underlying component
- super.paintComponent(g);
- // set the color of the outline
- g.setColor(Color.BLACK);
- g.drawRect(0, 0, 47, 47);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement