/** @author Scott Marshall @author University of Glasgow, MSc IT Project 2001 @author Building an OnLine Course in Computing Fundamentals */ package ukacgla_2inputKMap; import ukacgla_KMap.*; import java.util.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.table.TableColumn; import javax.swing.SwingUtilities; import java.awt.*; import java.awt.event.*; import java.applet.Applet; public class Ex02_Frame extends KMap_Frame { Ex02_Random rand; private int noOfRows; private int noOfCols; public Ex02_Frame(JApplet m, int n, int o, String[] c){ super(m, n, o, c); columnNames = c; this.noOfRows = n; this.noOfCols = o; noOfOptions = 4; //number of checkboxes mkUI(); } /** Builds a new table model, calculates the answers, and redraws the panel on the screen. */ protected void newTable() { table.setModel(model = new KMapTableModel(columnNames)); model.proofReadTable(); buildAnswers(); mkCheckBoxPanel(); } /** Builds the answers for the K Map. One will be correct, the rest will be incorrect. */ protected void buildAnswers(){ Vector oneCells = new Vector(); //Cells in this vector will result in a one Vector zeroCells = new Vector(); //Cells in this vector will result in a zero answers = new Vector(); //will hold all 4 minterms generated Cell cell; //find expressions and place into correct vectors for (int a=1; a