SlideShare a Scribd company logo
1 of 17
Download to read offline
Getting some errors when trying to run this program, can anyone help fix?
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
/**
* Sudoku program that validates and finds a solution.
* @author
* @
*
*/
public class SudokuSolver extends JFrame implements ActionListener {
/** UID */
private static final long serialVersionUID = 3883151525928534467L;
/** Contains UI for cells */
private SudokuCell[][] sudokuCells;
/** Contains integers representing values in cells. */
private int[][] cellValues;
/**
* Constructor.
* Set up the components and initialize Sudoku.
*/
public SudokuSolver() {
super("Sudoku Solver");
prepareSudokuUI();
// JFrame property
setLayout(new FlowLayout(FlowLayout.CENTER));
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((d.width / 2 - 175), (d.height / 2 - 275));
setResizable(false);
setVisible(true);
}
/**
* Set up the UI for application.
*/
private void prepareSudokuUI() {
// Used to align the title, Sudoku grid, and button panels vertically
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
// Title panel
JPanel title = new JPanel();
title.add(new JLabel(new ImageIcon(getClass().getResource("/resources/title.png"))));
// Sudoku grid panel
JPanel sudokuPanel = new JPanel();
sudokuPanel.setLayout(new GridLayout(3, 3, 1, 1));
// Set up 9 3x3 box panels
JPanel[] boxes = new JPanel[9];
boxes = prepare3x3BoxUI(sudokuPanel, boxes);
// Set up SudokuCells
cellValues = new int[9][9];
sudokuCells = new SudokuCell[9][9];
prepareSudokuCellsUI(boxes);
// Bottom part containing buttons
// First row of buttons
JPanel buttonsPanel = new JPanel();
JButton submitButton = new JButton("Submit"); // Submit to validate the Sudoku
JButton solveButton = new JButton("Solve"); // Solve the Sudoku
JButton eraseButton = new JButton("Erase"); // Clear the cells that are not fixed
JButton eraseAllButton = new JButton("Erase All"); // Clear all cells including fixed ones
buttonsPanel.add(submitButton);
buttonsPanel.add(solveButton);
buttonsPanel.add(eraseButton);
buttonsPanel.add(eraseAllButton);
// Second row of buttons
JPanel buttonsPanel2 = new JPanel();
JButton presetButton = new JButton("Mark As Preset"); // Set filled cells as preset (not
editable)
buttonsPanel2.add(presetButton);
submitButton.addActionListener(this);
solveButton.addActionListener(this);
presetButton.addActionListener(this);
eraseButton.addActionListener(this);
eraseAllButton.addActionListener(this);
panel.add(title);
panel.add(sudokuPanel);
panel.add(buttonsPanel);
panel.add(buttonsPanel2);
add(panel);
}
/**
* Set up 9 3x3 panels for Sudoku panel.
* Use 9 panels to align as 3x3 boxes.
* @param sudokuPanel
* @param boxes 3x3 box panels to be added on Sudoku panel.
* @return instantiated 3x3 box panels.
*/
private JPanel[] prepare3x3BoxUI(JPanel sudokuPanel, JPanel[] boxes) {
for (int i = 0; i < 9; i++) {
boxes[i] = new JPanel();
boxes[i].setLayout(new GridLayout(3, 3, 0, 0));
boxes[i].setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK));
sudokuPanel.add(boxes[i]);
}
return boxes;
}
/**
* Set up cells UI(SudokuCell) for input and add them to the panels.
* SudokuCells have to be added to proper panels meaning left-right and top-bottom order
within 3x3 box.
* @param boxes
*/
private void prepareSudokuCellsUI(JPanel[] boxes) {
int index = 0;
// Adjust current row
for (int i = 0; i < 9; i++) {
if (i <= 2)
index = 0;
else if (i <= 5)
index = 3;
else
index = 6;
for (int j = 0; j < 9; j++) {
sudokuCells[i][j] = new SudokuCell(i, j);
boxes[index + (j / 3)].add(sudokuCells[i][j]);
}
}
}
@Override
public void actionPerformed(ActionEvent event) {
JButton button = (JButton) event.getSource();
String buttonType = button.getText();
if (buttonType.equals("Submit"))
submitSudoku();
else if (buttonType.equals("Solve"))
startSolving();
else if (buttonType.equals("Erase"))
erase();
else if (buttonType.equals("Erase All"))
eraseAllIncludingPresetCells();
else
checkPresetCells();
}
/**
* Submit current Sudokue to validate for completeness.
*/
private void submitSudoku() {
if (isSudokuSolved())
JOptionPane.showMessageDialog(getRootPane(),
"Congratulations!
Sudoku has been Completed!",
"Sudoku Validation", JOptionPane.INFORMATION_MESSAGE);
else
JOptionPane.showMessageDialog(getRootPane(),
"Failed!
Sudoku is not complete!",
"Sudoku Validation", JOptionPane.INFORMATION_MESSAGE);
}
/**
* Start working on the Sudoku if it is ready.
*/
private void startSolving() {
// Don't do anything if Sudoku is already full
if (isSudokuFull()) {
JOptionPane.showMessageDialog(getRootPane(),
"There are no cells open to start from.",
"Solving Sudoku", JOptionPane.ERROR_MESSAGE);
return;
}
// Validate before starting
if (isValidToStart()) {
markAsPresetCells();
if (!solve(0, 0))
JOptionPane.showMessageDialog(getRootPane(),
"Unable to solve.",
"Solving Sudoku", JOptionPane.ERROR_MESSAGE);
} else // Don't start solving if Sudoku is not valid at the start
JOptionPane.showMessageDialog(getRootPane(),
"This is not a valid Sudoku to start.",
"Solving Sudoku", JOptionPane.ERROR_MESSAGE);
}
/**
* Erase all editable cells.
*/
private void erase() {
for (int i = 0; i < 9; i++)
for (int j = 0; j < 9; j++) {
if (cellValues[i][j] != 0) {
if (sudokuCells[i][j].editable) {
sudokuCells[i][j].setText("");
cellValues[i][j] = 0;
}
}
}
}
/**
* Erase all cell values including those with fixed values.
*/
private void eraseAllIncludingPresetCells() {
for (int i = 0; i < 9; i++)
for (int j = 0; j < 9; j++) {
if (cellValues[i][j] != 0) {
if (!sudokuCells[i][j].editable) {
sudokuCells[i][j].editable = true;
sudokuCells[i][j].setEditable(true);
sudokuCells[i][j].setForeground(Color.BLACK);
}
sudokuCells[i][j].setText("");
cellValues[i][j] = 0;
}
}
}
/**
* Evaluate cells before making pre filled cells fixed.
*/
private void checkPresetCells() {
// Validate the current state and make the filled cells fixed
if (!isValidToStart())
JOptionPane.showMessageDialog(getRootPane(),
"This is not a valid Sudoku to start.",
"Sudoku Solver", JOptionPane.ERROR_MESSAGE);
else
markAsPresetCells();
}
/**
* Check if the Sudoku puzzle is solved correctly.
* @return true if Sudoku is correct.
*/
private boolean isSudokuSolved() {
for (int i = 0; i < 9; i++) {
int[] aRow = new int[9];
int[] aCol = new int[9];
for (int j = 0; j < 9; j++) {
// If this cell is empty, quit because it's not complete
if (cellValues[i][j] == 0)
return false;
aRow[j] = cellValues[i][j];
aCol[j] = cellValues[j][i];
// Check if the value in this cell is duplicated in 3x3 box
if (isContainedIn3x3Box(i, j, cellValues[i][j]))
return false;
}
// Check rows and columns
if (!isRowColumnCorrect(aRow, aCol))
return false;
}
return true;
}
/**
* Check if specified row and column are correct.
* Used when submitting the puzzle.
* @param aRow 9 numbers in a row.
* @param aCol 9 numbers in a column.
* @return true if this row and column are correct.
*/
private boolean isRowColumnCorrect(int[] aRow, int[] aCol) {
Arrays.sort(aRow);
Arrays.sort(aCol);
for (int i = 0; i < 9; i++)
if (aRow[i] != i + 1 && aCol[i] != i + 1)
return false;
return true;
}
/**
* Check if Sudoku is in valid condition to start.
* @return true if Sudoku is ready to start.
*/
private boolean isValidToStart() {
for (int i = 0; i < 9; i++)
for (int j = 0; j < 9; j++)
if (cellValues[i][j] != 0)
if (isContainedIn3x3Box(i, j, cellValues[i][j]) ||
isContainedInRowColumn(i, j, cellValues[i][j]))
return false;
return true;
}
/**
* Make the filled cells fixed.
*/
private void markAsPresetCells() {
for (int i = 0; i < 9; i++)
for (int j = 0; j < 9; j++)
if (cellValues[i][j] != 0)
if (!isContainedIn3x3Box(i, j, cellValues[i][j]) &&
!isContainedInRowColumn(i, j, cellValues[i][j])) {
sudokuCells[i][j].editable = false;
sudokuCells[i][j].setEditable(false);
sudokuCells[i][j].setForeground(new Color(150, 150, 150));
}
}
/**
* Check if a value contains in its 3x3 box for a cell.
* @param row current row index.
* @param col current column index.
* @return true if this cell is incorrect or duplicated in its 3x3 box.
*/
private boolean isContainedIn3x3Box(int row, int col, int value) {
// Find the top left of its 3x3 box to start validating from
int startRow = row / 3 * 3;
int startCol = col / 3 * 3;
// Check within its 3x3 box except its cell
for (int i = startRow; i < startRow + 3; i++)
for (int j = startCol; j < startCol + 3; j++)
if (!(i == row && j == col))
if (cellValues[i][j] == value)
return true;
return false;
}
/**
* Check if a value is contained within its row and column.
* Used when solving the puzzle.
* @param row current row index.
* @param col current column index.
* @param value value in this cell.
* @return true if this value is duplicated in its row and column.
*/
private boolean isContainedInRowColumn(int row, int col, int value) {
for (int i = 0; i < 9; i++) {
// Don't check the same cell
if (i != col)
if (cellValues[row][i] == value)
return true;
if (i != row)
if (cellValues[i][col] == value)
return true;
}
return false;
}
/**
* Check if all cells are filled up.
* @return true if Sudoku is full.
*/
private boolean isSudokuFull() {
for (int i = 0; i < 9; i++)
for (int j = 0; j < 9; j++)
if (cellValues[i][j] == 0)
return false;
return true;
}
/**
* Solve Sudoku recursively.
* @param row current row index.
* @param col current column index.
* @return false if Sudoku is not solved. true if Sudoku is solved.
*/
private boolean solve(int row, int col) {
// If it has passed through all cells, start quitting
if (row == 9)
return true;
// If this cell is already set(fixed), skip to the next cell
if (cellValues[row][col] != 0) {
if (solve(col == 8? (row + 1): row, (col + 1) % 9))
return true;
} else {
// Random numbers 1 - 9
Integer[] randoms = generateRandomNumbers();
for (int i = 0; i < 9; i++) {
// If no duplicates in this row, column, 3x3, assign the value and go to the next
if (!isContainedInRowColumn(row, col, randoms[i]) &&
!isContainedIn3x3Box(row, col, randoms[i])) {
cellValues[row][col] = randoms[i];
sudokuCells[row][col].setText(String.valueOf(randoms[i]));
// Move to the next cell left-to-right and top-to-bottom
if (solve(col == 8? (row + 1) : row, (col + 1) % 9))
return true;
else {
// Initialize the cell when backtracking (case when the value in the next cell was
not valid)
cellValues[row][col] = 0;
sudokuCells[row][col].setText("");
}
}
}
}
return false;
}
/**
* Generate 9 unique random numbers.
* @return array containing 9 random unique numbers.
*/
private Integer[] generateRandomNumbers() {
ArrayList randoms = new ArrayList();
for (int i = 0; i < 9; i++)
randoms.add(i + 1);
Collections.shuffle(randoms);
return randoms.toArray(new Integer[9]);
}
/**
* A SudokuCell represents a cell for input.
*
*
*/
private class SudokuCell extends JTextField {
/** UID */
private static final long serialVersionUID = 4690751052748480438L;
/** Determine if this cell can accept input. */
private boolean editable;
/**
* Constructor
* @param row index for row of this cell.
* @param col index for column of this cell.
*/
public SudokuCell(final int row, final int col) {
super(1);
editable = true;
setBackground(Color.WHITE);
setBorder(BorderFactory.createLineBorder(Color.GRAY));
setHorizontalAlignment(CENTER);
setPreferredSize(new Dimension(35, 35));
setFont(new Font("Lucida Console", Font.BOLD, 28));
addFocusListener(new FocusListener(){
@Override
public void focusGained(FocusEvent arg0) {
// Change colors of fields located in vertical, horizontal, and 3x3 fields
int startRow = row / 3 * 3;
int startCol = col / 3 * 3;
for (int i = 0; i < 9; i++) {
// Horizontal
sudokuCells[i][col].setBackground(new Color(255, 227, 209));
// Vertical
sudokuCells[row][i].setBackground(new Color(255, 227, 209));
}
// 3x3 box
for (int i = startRow; i < startRow + 3; i++)
for (int j = startCol; j < startCol + 3; j++)
sudokuCells[i][j].setBackground(new Color(255, 227, 209));
}
@Override
public void focusLost(FocusEvent arg0) {
// Set the previous color of fields back to white
int startRow = row / 3 * 3;
int startCol = col / 3 * 3;
// Reset focus (set background color back to white)
for (int i = 0; i < 9; i++) {
// Horizontal
sudokuCells[i][col].setBackground(Color.WHITE);
// Vertical
sudokuCells[row][i].setBackground(Color.WHITE);
}
// 3x3 box
for (int i = startRow; i < startRow + 3; i++)
for (int j = startCol; j < startCol + 3; j++)
sudokuCells[i][j].setBackground(Color.WHITE);
}
});
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
// Only allow numeric input
if (editable)
if (e.getKeyChar() >= '1' && e.getKeyChar() <= '9') {
setEditable(true);
setText(""); // Keep it 1 letter
cellValues[row][col] = e.getKeyChar() - 48;
} else if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
setEditable(true);
setText("0"); // Avoid beep sound
cellValues[row][col] = 0;
} else
setEditable(false);
// Navigation by arrow keys
switch (e.getKeyCode()) {
case KeyEvent.VK_DOWN:
sudokuCells[(row + 1) % 9][col].requestFocusInWindow();
break;
case KeyEvent.VK_RIGHT:
sudokuCells[row][(col + 1) % 9].requestFocusInWindow();
break;
case KeyEvent.VK_UP:
sudokuCells[(row == 0)? 8 : (row - 1)][col].requestFocusInWindow();
break;
case KeyEvent.VK_LEFT:
sudokuCells[row][(col == 0)? 8 : (col - 1)].requestFocusInWindow();
break;
}
}
});
}
}
/**
* @param args
*/
public static void main(String[] args) {
new SudokuSolver();
}
}
Solution
Hi,
When i just copied the code above to eclipse and tried running this is the error i get:
Exception in thread "main" java.lang.NullPointerException
at javax.swing.ImageIcon.(ImageIcon.java:205)
at SudokuSolver.prepareSudokuUI(SudokuSolver.java:67)
at SudokuSolver.(SudokuSolver.java:45)
at SudokuSolver.main(SudokuSolver.java:550)
That is the only error i got
And the reason for the error is
title.add(new JLabel(new ImageIcon(getClass().getResource("/resources/title.png")))); this
perticular line in private void prepareSudokuUI() function. we should give a image file to the
program so give a correct path where you have copied the image file.
my suggestion is that u keep a image file in the same folder where you have this perticular .java
file and just replace the path with image file name
name. title.add(new JLabel(new ImageIcon(getClass().getResource("myimage.png")))); That
will work :)
if you are getting any other error you should specify in the question. Anyfurther clarification
needed comment below.

More Related Content

Similar to Getting some errors when trying to run this program, can anyone help.pdf

How do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdfHow do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdfforwardcom41
 
Repetition Structure
Repetition StructureRepetition Structure
Repetition StructurePRN USM
 
Please review my code (java)Someone helped me with it but i cannot.pdf
Please review my code (java)Someone helped me with it but i cannot.pdfPlease review my code (java)Someone helped me with it but i cannot.pdf
Please review my code (java)Someone helped me with it but i cannot.pdffathimafancyjeweller
 
Practice using layouts Anderson, Franceschi import javax..pdf
Practice using layouts Anderson, Franceschi import javax..pdfPractice using layouts Anderson, Franceschi import javax..pdf
Practice using layouts Anderson, Franceschi import javax..pdfxlynettalampleyxc
 
#include fstream#include iostream#include cstdlib#includ.docx
#include fstream#include iostream#include cstdlib#includ.docx#include fstream#include iostream#include cstdlib#includ.docx
#include fstream#include iostream#include cstdlib#includ.docxajoy21
 
So I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdfSo I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdfaksahnan
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfravikapoorindia
 
Tic Tac Toe game with GUI please dont copy and paste from google. .pdf
Tic Tac Toe game with GUI please dont copy and paste from google. .pdfTic Tac Toe game with GUI please dont copy and paste from google. .pdf
Tic Tac Toe game with GUI please dont copy and paste from google. .pdfformaxekochi
 
Need help writing the code for a basic java tic tac toe game Tic.pdf
Need help writing the code for a basic java tic tac toe game Tic.pdfNeed help writing the code for a basic java tic tac toe game Tic.pdf
Need help writing the code for a basic java tic tac toe game Tic.pdfhainesburchett26321
 
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docxNew folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docxcurwenmichaela
 
META-INFMANIFEST.MFManifest-Version 1.0.classpath.docx
META-INFMANIFEST.MFManifest-Version 1.0.classpath.docxMETA-INFMANIFEST.MFManifest-Version 1.0.classpath.docx
META-INFMANIFEST.MFManifest-Version 1.0.classpath.docxandreecapon
 
Objectives In this lab you will review passing arrays to methods and.pdf
Objectives In this lab you will review passing arrays to methods and.pdfObjectives In this lab you will review passing arrays to methods and.pdf
Objectives In this lab you will review passing arrays to methods and.pdff3apparelsonline
 
Java Question help needed In the program Fill the Add statements.pdf
Java Question  help needed In the program Fill the Add statements.pdfJava Question  help needed In the program Fill the Add statements.pdf
Java Question help needed In the program Fill the Add statements.pdfkamdinrossihoungma74
 
Othello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfOthello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfarccreation001
 
Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdf
Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdfListings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdf
Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdfRAJATCHUGH12
 
Java ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfJava ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfatulkapoor33
 
PLEASE HELP ME !!IT IS Due Tonight ;(!How can I make the add but.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!How can I make the add but.pdfPLEASE HELP ME !!IT IS Due Tonight ;(!How can I make the add but.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!How can I make the add but.pdfbadshetoms
 
Java Foundations StackADT-java --- - Defines the interface to a stack.docx
Java Foundations StackADT-java ---  - Defines the interface to a stack.docxJava Foundations StackADT-java ---  - Defines the interface to a stack.docx
Java Foundations StackADT-java --- - Defines the interface to a stack.docxVictorXUQGloverl
 

Similar to Getting some errors when trying to run this program, can anyone help.pdf (20)

How do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdfHow do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdf
 
Repetition Structure
Repetition StructureRepetition Structure
Repetition Structure
 
Please review my code (java)Someone helped me with it but i cannot.pdf
Please review my code (java)Someone helped me with it but i cannot.pdfPlease review my code (java)Someone helped me with it but i cannot.pdf
Please review my code (java)Someone helped me with it but i cannot.pdf
 
Practice using layouts Anderson, Franceschi import javax..pdf
Practice using layouts Anderson, Franceschi import javax..pdfPractice using layouts Anderson, Franceschi import javax..pdf
Practice using layouts Anderson, Franceschi import javax..pdf
 
#include fstream#include iostream#include cstdlib#includ.docx
#include fstream#include iostream#include cstdlib#includ.docx#include fstream#include iostream#include cstdlib#includ.docx
#include fstream#include iostream#include cstdlib#includ.docx
 
So I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdfSo I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdf
 
T
TT
T
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdf
 
Tic Tac Toe game with GUI please dont copy and paste from google. .pdf
Tic Tac Toe game with GUI please dont copy and paste from google. .pdfTic Tac Toe game with GUI please dont copy and paste from google. .pdf
Tic Tac Toe game with GUI please dont copy and paste from google. .pdf
 
Need help writing the code for a basic java tic tac toe game Tic.pdf
Need help writing the code for a basic java tic tac toe game Tic.pdfNeed help writing the code for a basic java tic tac toe game Tic.pdf
Need help writing the code for a basic java tic tac toe game Tic.pdf
 
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docxNew folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
 
7 stacksqueues
7 stacksqueues7 stacksqueues
7 stacksqueues
 
META-INFMANIFEST.MFManifest-Version 1.0.classpath.docx
META-INFMANIFEST.MFManifest-Version 1.0.classpath.docxMETA-INFMANIFEST.MFManifest-Version 1.0.classpath.docx
META-INFMANIFEST.MFManifest-Version 1.0.classpath.docx
 
Objectives In this lab you will review passing arrays to methods and.pdf
Objectives In this lab you will review passing arrays to methods and.pdfObjectives In this lab you will review passing arrays to methods and.pdf
Objectives In this lab you will review passing arrays to methods and.pdf
 
Java Question help needed In the program Fill the Add statements.pdf
Java Question  help needed In the program Fill the Add statements.pdfJava Question  help needed In the program Fill the Add statements.pdf
Java Question help needed In the program Fill the Add statements.pdf
 
Othello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfOthello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdf
 
Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdf
Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdfListings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdf
Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdf
 
Java ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfJava ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdf
 
PLEASE HELP ME !!IT IS Due Tonight ;(!How can I make the add but.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!How can I make the add but.pdfPLEASE HELP ME !!IT IS Due Tonight ;(!How can I make the add but.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!How can I make the add but.pdf
 
Java Foundations StackADT-java --- - Defines the interface to a stack.docx
Java Foundations StackADT-java ---  - Defines the interface to a stack.docxJava Foundations StackADT-java ---  - Defines the interface to a stack.docx
Java Foundations StackADT-java --- - Defines the interface to a stack.docx
 

More from mohammedfootwear

Discuss what is meant by Project Scope ManagementSolutionA pr.pdf
Discuss what is meant by Project Scope ManagementSolutionA pr.pdfDiscuss what is meant by Project Scope ManagementSolutionA pr.pdf
Discuss what is meant by Project Scope ManagementSolutionA pr.pdfmohammedfootwear
 
Determine if statement is true or false. If johnny likes suzy the ri.pdf
Determine if statement is true or false. If johnny likes suzy the ri.pdfDetermine if statement is true or false. If johnny likes suzy the ri.pdf
Determine if statement is true or false. If johnny likes suzy the ri.pdfmohammedfootwear
 
Describe one safeguard that should be in place to protect the confid.pdf
Describe one safeguard that should be in place to protect the confid.pdfDescribe one safeguard that should be in place to protect the confid.pdf
Describe one safeguard that should be in place to protect the confid.pdfmohammedfootwear
 
Create a storyboard prototype of a mobile app.When creating a stor.pdf
Create a storyboard prototype of a mobile app.When creating a stor.pdfCreate a storyboard prototype of a mobile app.When creating a stor.pdf
Create a storyboard prototype of a mobile app.When creating a stor.pdfmohammedfootwear
 
Are you familiar with the term parochialism What could be happen.pdf
Are you familiar with the term parochialism What could be happen.pdfAre you familiar with the term parochialism What could be happen.pdf
Are you familiar with the term parochialism What could be happen.pdfmohammedfootwear
 
Answer the question, What market structure is the airline industry.pdf
Answer the question, What market structure is the airline industry.pdfAnswer the question, What market structure is the airline industry.pdf
Answer the question, What market structure is the airline industry.pdfmohammedfootwear
 
Adding methods to the ListBag classIn the file ListBag.py, add the.pdf
Adding methods to the ListBag classIn the file ListBag.py, add the.pdfAdding methods to the ListBag classIn the file ListBag.py, add the.pdf
Adding methods to the ListBag classIn the file ListBag.py, add the.pdfmohammedfootwear
 
5. value 10.00 polnts On May 1, Soriano Co. reported the following ac.pdf
5. value 10.00 polnts On May 1, Soriano Co. reported the following ac.pdf5. value 10.00 polnts On May 1, Soriano Co. reported the following ac.pdf
5. value 10.00 polnts On May 1, Soriano Co. reported the following ac.pdfmohammedfootwear
 
C programming. Answer question only in C code In the eighth part, yo.pdf
C programming. Answer question only in C code In the eighth part, yo.pdfC programming. Answer question only in C code In the eighth part, yo.pdf
C programming. Answer question only in C code In the eighth part, yo.pdfmohammedfootwear
 
Biology Lab questions1. Why can a very small amount of bacteria b.pdf
Biology Lab questions1. Why can a very small amount of bacteria b.pdfBiology Lab questions1. Why can a very small amount of bacteria b.pdf
Biology Lab questions1. Why can a very small amount of bacteria b.pdfmohammedfootwear
 
You will choose a country, other than the USA or Turkey, that you wo.pdf
You will choose a country, other than the USA or Turkey, that you wo.pdfYou will choose a country, other than the USA or Turkey, that you wo.pdf
You will choose a country, other than the USA or Turkey, that you wo.pdfmohammedfootwear
 
Why does the RNA polymerase complex in eukaryotes contain a histone .pdf
Why does the RNA polymerase complex in eukaryotes contain a histone .pdfWhy does the RNA polymerase complex in eukaryotes contain a histone .pdf
Why does the RNA polymerase complex in eukaryotes contain a histone .pdfmohammedfootwear
 
what Linux command allows you to scan the disk for partition changes.pdf
what Linux command allows you to scan the disk for partition changes.pdfwhat Linux command allows you to scan the disk for partition changes.pdf
what Linux command allows you to scan the disk for partition changes.pdfmohammedfootwear
 
What is the correct answer Chrome File Edit View History Bookmarks.pdf
What is the correct answer Chrome File Edit View History Bookmarks.pdfWhat is the correct answer Chrome File Edit View History Bookmarks.pdf
What is the correct answer Chrome File Edit View History Bookmarks.pdfmohammedfootwear
 
What is fault tolerance, and what network aspects must be monitored .pdf
What is fault tolerance, and what network aspects must be monitored .pdfWhat is fault tolerance, and what network aspects must be monitored .pdf
What is fault tolerance, and what network aspects must be monitored .pdfmohammedfootwear
 
Using SQL Developer ONLY!Your assignment is to create an auditing .pdf
Using SQL Developer ONLY!Your assignment is to create an auditing .pdfUsing SQL Developer ONLY!Your assignment is to create an auditing .pdf
Using SQL Developer ONLY!Your assignment is to create an auditing .pdfmohammedfootwear
 
Use the definition of big- Theta to prove that 5x^4 + 2x^3 - 1 is The.pdf
Use the definition of big- Theta to prove that 5x^4 + 2x^3 - 1 is The.pdfUse the definition of big- Theta to prove that 5x^4 + 2x^3 - 1 is The.pdf
Use the definition of big- Theta to prove that 5x^4 + 2x^3 - 1 is The.pdfmohammedfootwear
 
To what degree, if any, has America’s ascendancy on the world stage .pdf
To what degree, if any, has America’s ascendancy on the world stage .pdfTo what degree, if any, has America’s ascendancy on the world stage .pdf
To what degree, if any, has America’s ascendancy on the world stage .pdfmohammedfootwear
 
This for English class.I need help for writing 4 to 5 paragraphs a.pdf
This for English class.I need help for writing 4 to 5 paragraphs a.pdfThis for English class.I need help for writing 4 to 5 paragraphs a.pdf
This for English class.I need help for writing 4 to 5 paragraphs a.pdfmohammedfootwear
 
The debt ratio is the relationship between O A. total assets and cur.pdf
The debt ratio is the relationship between O A. total assets and cur.pdfThe debt ratio is the relationship between O A. total assets and cur.pdf
The debt ratio is the relationship between O A. total assets and cur.pdfmohammedfootwear
 

More from mohammedfootwear (20)

Discuss what is meant by Project Scope ManagementSolutionA pr.pdf
Discuss what is meant by Project Scope ManagementSolutionA pr.pdfDiscuss what is meant by Project Scope ManagementSolutionA pr.pdf
Discuss what is meant by Project Scope ManagementSolutionA pr.pdf
 
Determine if statement is true or false. If johnny likes suzy the ri.pdf
Determine if statement is true or false. If johnny likes suzy the ri.pdfDetermine if statement is true or false. If johnny likes suzy the ri.pdf
Determine if statement is true or false. If johnny likes suzy the ri.pdf
 
Describe one safeguard that should be in place to protect the confid.pdf
Describe one safeguard that should be in place to protect the confid.pdfDescribe one safeguard that should be in place to protect the confid.pdf
Describe one safeguard that should be in place to protect the confid.pdf
 
Create a storyboard prototype of a mobile app.When creating a stor.pdf
Create a storyboard prototype of a mobile app.When creating a stor.pdfCreate a storyboard prototype of a mobile app.When creating a stor.pdf
Create a storyboard prototype of a mobile app.When creating a stor.pdf
 
Are you familiar with the term parochialism What could be happen.pdf
Are you familiar with the term parochialism What could be happen.pdfAre you familiar with the term parochialism What could be happen.pdf
Are you familiar with the term parochialism What could be happen.pdf
 
Answer the question, What market structure is the airline industry.pdf
Answer the question, What market structure is the airline industry.pdfAnswer the question, What market structure is the airline industry.pdf
Answer the question, What market structure is the airline industry.pdf
 
Adding methods to the ListBag classIn the file ListBag.py, add the.pdf
Adding methods to the ListBag classIn the file ListBag.py, add the.pdfAdding methods to the ListBag classIn the file ListBag.py, add the.pdf
Adding methods to the ListBag classIn the file ListBag.py, add the.pdf
 
5. value 10.00 polnts On May 1, Soriano Co. reported the following ac.pdf
5. value 10.00 polnts On May 1, Soriano Co. reported the following ac.pdf5. value 10.00 polnts On May 1, Soriano Co. reported the following ac.pdf
5. value 10.00 polnts On May 1, Soriano Co. reported the following ac.pdf
 
C programming. Answer question only in C code In the eighth part, yo.pdf
C programming. Answer question only in C code In the eighth part, yo.pdfC programming. Answer question only in C code In the eighth part, yo.pdf
C programming. Answer question only in C code In the eighth part, yo.pdf
 
Biology Lab questions1. Why can a very small amount of bacteria b.pdf
Biology Lab questions1. Why can a very small amount of bacteria b.pdfBiology Lab questions1. Why can a very small amount of bacteria b.pdf
Biology Lab questions1. Why can a very small amount of bacteria b.pdf
 
You will choose a country, other than the USA or Turkey, that you wo.pdf
You will choose a country, other than the USA or Turkey, that you wo.pdfYou will choose a country, other than the USA or Turkey, that you wo.pdf
You will choose a country, other than the USA or Turkey, that you wo.pdf
 
Why does the RNA polymerase complex in eukaryotes contain a histone .pdf
Why does the RNA polymerase complex in eukaryotes contain a histone .pdfWhy does the RNA polymerase complex in eukaryotes contain a histone .pdf
Why does the RNA polymerase complex in eukaryotes contain a histone .pdf
 
what Linux command allows you to scan the disk for partition changes.pdf
what Linux command allows you to scan the disk for partition changes.pdfwhat Linux command allows you to scan the disk for partition changes.pdf
what Linux command allows you to scan the disk for partition changes.pdf
 
What is the correct answer Chrome File Edit View History Bookmarks.pdf
What is the correct answer Chrome File Edit View History Bookmarks.pdfWhat is the correct answer Chrome File Edit View History Bookmarks.pdf
What is the correct answer Chrome File Edit View History Bookmarks.pdf
 
What is fault tolerance, and what network aspects must be monitored .pdf
What is fault tolerance, and what network aspects must be monitored .pdfWhat is fault tolerance, and what network aspects must be monitored .pdf
What is fault tolerance, and what network aspects must be monitored .pdf
 
Using SQL Developer ONLY!Your assignment is to create an auditing .pdf
Using SQL Developer ONLY!Your assignment is to create an auditing .pdfUsing SQL Developer ONLY!Your assignment is to create an auditing .pdf
Using SQL Developer ONLY!Your assignment is to create an auditing .pdf
 
Use the definition of big- Theta to prove that 5x^4 + 2x^3 - 1 is The.pdf
Use the definition of big- Theta to prove that 5x^4 + 2x^3 - 1 is The.pdfUse the definition of big- Theta to prove that 5x^4 + 2x^3 - 1 is The.pdf
Use the definition of big- Theta to prove that 5x^4 + 2x^3 - 1 is The.pdf
 
To what degree, if any, has America’s ascendancy on the world stage .pdf
To what degree, if any, has America’s ascendancy on the world stage .pdfTo what degree, if any, has America’s ascendancy on the world stage .pdf
To what degree, if any, has America’s ascendancy on the world stage .pdf
 
This for English class.I need help for writing 4 to 5 paragraphs a.pdf
This for English class.I need help for writing 4 to 5 paragraphs a.pdfThis for English class.I need help for writing 4 to 5 paragraphs a.pdf
This for English class.I need help for writing 4 to 5 paragraphs a.pdf
 
The debt ratio is the relationship between O A. total assets and cur.pdf
The debt ratio is the relationship between O A. total assets and cur.pdfThe debt ratio is the relationship between O A. total assets and cur.pdf
The debt ratio is the relationship between O A. total assets and cur.pdf
 

Recently uploaded

Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptxPoojaSen20
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint23600690
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 

Recently uploaded (20)

Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 

Getting some errors when trying to run this program, can anyone help.pdf

  • 1. Getting some errors when trying to run this program, can anyone help fix? import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridLayout; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; /** * Sudoku program that validates and finds a solution. * @author * @ * */ public class SudokuSolver extends JFrame implements ActionListener { /** UID */ private static final long serialVersionUID = 3883151525928534467L; /** Contains UI for cells */
  • 2. private SudokuCell[][] sudokuCells; /** Contains integers representing values in cells. */ private int[][] cellValues; /** * Constructor. * Set up the components and initialize Sudoku. */ public SudokuSolver() { super("Sudoku Solver"); prepareSudokuUI(); // JFrame property setLayout(new FlowLayout(FlowLayout.CENTER)); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pack(); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); setLocation((d.width / 2 - 175), (d.height / 2 - 275)); setResizable(false); setVisible(true); } /** * Set up the UI for application. */ private void prepareSudokuUI() { // Used to align the title, Sudoku grid, and button panels vertically JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); // Title panel JPanel title = new JPanel(); title.add(new JLabel(new ImageIcon(getClass().getResource("/resources/title.png")))); // Sudoku grid panel JPanel sudokuPanel = new JPanel();
  • 3. sudokuPanel.setLayout(new GridLayout(3, 3, 1, 1)); // Set up 9 3x3 box panels JPanel[] boxes = new JPanel[9]; boxes = prepare3x3BoxUI(sudokuPanel, boxes); // Set up SudokuCells cellValues = new int[9][9]; sudokuCells = new SudokuCell[9][9]; prepareSudokuCellsUI(boxes); // Bottom part containing buttons // First row of buttons JPanel buttonsPanel = new JPanel(); JButton submitButton = new JButton("Submit"); // Submit to validate the Sudoku JButton solveButton = new JButton("Solve"); // Solve the Sudoku JButton eraseButton = new JButton("Erase"); // Clear the cells that are not fixed JButton eraseAllButton = new JButton("Erase All"); // Clear all cells including fixed ones buttonsPanel.add(submitButton); buttonsPanel.add(solveButton); buttonsPanel.add(eraseButton); buttonsPanel.add(eraseAllButton); // Second row of buttons JPanel buttonsPanel2 = new JPanel(); JButton presetButton = new JButton("Mark As Preset"); // Set filled cells as preset (not editable) buttonsPanel2.add(presetButton); submitButton.addActionListener(this); solveButton.addActionListener(this); presetButton.addActionListener(this); eraseButton.addActionListener(this); eraseAllButton.addActionListener(this); panel.add(title);
  • 4. panel.add(sudokuPanel); panel.add(buttonsPanel); panel.add(buttonsPanel2); add(panel); } /** * Set up 9 3x3 panels for Sudoku panel. * Use 9 panels to align as 3x3 boxes. * @param sudokuPanel * @param boxes 3x3 box panels to be added on Sudoku panel. * @return instantiated 3x3 box panels. */ private JPanel[] prepare3x3BoxUI(JPanel sudokuPanel, JPanel[] boxes) { for (int i = 0; i < 9; i++) { boxes[i] = new JPanel(); boxes[i].setLayout(new GridLayout(3, 3, 0, 0)); boxes[i].setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK)); sudokuPanel.add(boxes[i]); } return boxes; } /** * Set up cells UI(SudokuCell) for input and add them to the panels. * SudokuCells have to be added to proper panels meaning left-right and top-bottom order within 3x3 box. * @param boxes */ private void prepareSudokuCellsUI(JPanel[] boxes) { int index = 0; // Adjust current row for (int i = 0; i < 9; i++) { if (i <= 2)
  • 5. index = 0; else if (i <= 5) index = 3; else index = 6; for (int j = 0; j < 9; j++) { sudokuCells[i][j] = new SudokuCell(i, j); boxes[index + (j / 3)].add(sudokuCells[i][j]); } } } @Override public void actionPerformed(ActionEvent event) { JButton button = (JButton) event.getSource(); String buttonType = button.getText(); if (buttonType.equals("Submit")) submitSudoku(); else if (buttonType.equals("Solve")) startSolving(); else if (buttonType.equals("Erase")) erase(); else if (buttonType.equals("Erase All")) eraseAllIncludingPresetCells(); else checkPresetCells(); } /** * Submit current Sudokue to validate for completeness. */ private void submitSudoku() { if (isSudokuSolved()) JOptionPane.showMessageDialog(getRootPane(),
  • 6. "Congratulations! Sudoku has been Completed!", "Sudoku Validation", JOptionPane.INFORMATION_MESSAGE); else JOptionPane.showMessageDialog(getRootPane(), "Failed! Sudoku is not complete!", "Sudoku Validation", JOptionPane.INFORMATION_MESSAGE); } /** * Start working on the Sudoku if it is ready. */ private void startSolving() { // Don't do anything if Sudoku is already full if (isSudokuFull()) { JOptionPane.showMessageDialog(getRootPane(), "There are no cells open to start from.", "Solving Sudoku", JOptionPane.ERROR_MESSAGE); return; } // Validate before starting if (isValidToStart()) { markAsPresetCells(); if (!solve(0, 0)) JOptionPane.showMessageDialog(getRootPane(), "Unable to solve.", "Solving Sudoku", JOptionPane.ERROR_MESSAGE); } else // Don't start solving if Sudoku is not valid at the start JOptionPane.showMessageDialog(getRootPane(), "This is not a valid Sudoku to start.", "Solving Sudoku", JOptionPane.ERROR_MESSAGE); } /**
  • 7. * Erase all editable cells. */ private void erase() { for (int i = 0; i < 9; i++) for (int j = 0; j < 9; j++) { if (cellValues[i][j] != 0) { if (sudokuCells[i][j].editable) { sudokuCells[i][j].setText(""); cellValues[i][j] = 0; } } } } /** * Erase all cell values including those with fixed values. */ private void eraseAllIncludingPresetCells() { for (int i = 0; i < 9; i++) for (int j = 0; j < 9; j++) { if (cellValues[i][j] != 0) { if (!sudokuCells[i][j].editable) { sudokuCells[i][j].editable = true; sudokuCells[i][j].setEditable(true); sudokuCells[i][j].setForeground(Color.BLACK); } sudokuCells[i][j].setText(""); cellValues[i][j] = 0; } } } /** * Evaluate cells before making pre filled cells fixed. */ private void checkPresetCells() {
  • 8. // Validate the current state and make the filled cells fixed if (!isValidToStart()) JOptionPane.showMessageDialog(getRootPane(), "This is not a valid Sudoku to start.", "Sudoku Solver", JOptionPane.ERROR_MESSAGE); else markAsPresetCells(); } /** * Check if the Sudoku puzzle is solved correctly. * @return true if Sudoku is correct. */ private boolean isSudokuSolved() { for (int i = 0; i < 9; i++) { int[] aRow = new int[9]; int[] aCol = new int[9]; for (int j = 0; j < 9; j++) { // If this cell is empty, quit because it's not complete if (cellValues[i][j] == 0) return false; aRow[j] = cellValues[i][j]; aCol[j] = cellValues[j][i]; // Check if the value in this cell is duplicated in 3x3 box if (isContainedIn3x3Box(i, j, cellValues[i][j])) return false; } // Check rows and columns if (!isRowColumnCorrect(aRow, aCol)) return false; }
  • 9. return true; } /** * Check if specified row and column are correct. * Used when submitting the puzzle. * @param aRow 9 numbers in a row. * @param aCol 9 numbers in a column. * @return true if this row and column are correct. */ private boolean isRowColumnCorrect(int[] aRow, int[] aCol) { Arrays.sort(aRow); Arrays.sort(aCol); for (int i = 0; i < 9; i++) if (aRow[i] != i + 1 && aCol[i] != i + 1) return false; return true; } /** * Check if Sudoku is in valid condition to start. * @return true if Sudoku is ready to start. */ private boolean isValidToStart() { for (int i = 0; i < 9; i++) for (int j = 0; j < 9; j++) if (cellValues[i][j] != 0) if (isContainedIn3x3Box(i, j, cellValues[i][j]) || isContainedInRowColumn(i, j, cellValues[i][j])) return false; return true; }
  • 10. /** * Make the filled cells fixed. */ private void markAsPresetCells() { for (int i = 0; i < 9; i++) for (int j = 0; j < 9; j++) if (cellValues[i][j] != 0) if (!isContainedIn3x3Box(i, j, cellValues[i][j]) && !isContainedInRowColumn(i, j, cellValues[i][j])) { sudokuCells[i][j].editable = false; sudokuCells[i][j].setEditable(false); sudokuCells[i][j].setForeground(new Color(150, 150, 150)); } } /** * Check if a value contains in its 3x3 box for a cell. * @param row current row index. * @param col current column index. * @return true if this cell is incorrect or duplicated in its 3x3 box. */ private boolean isContainedIn3x3Box(int row, int col, int value) { // Find the top left of its 3x3 box to start validating from int startRow = row / 3 * 3; int startCol = col / 3 * 3; // Check within its 3x3 box except its cell for (int i = startRow; i < startRow + 3; i++) for (int j = startCol; j < startCol + 3; j++) if (!(i == row && j == col)) if (cellValues[i][j] == value) return true; return false; } /**
  • 11. * Check if a value is contained within its row and column. * Used when solving the puzzle. * @param row current row index. * @param col current column index. * @param value value in this cell. * @return true if this value is duplicated in its row and column. */ private boolean isContainedInRowColumn(int row, int col, int value) { for (int i = 0; i < 9; i++) { // Don't check the same cell if (i != col) if (cellValues[row][i] == value) return true; if (i != row) if (cellValues[i][col] == value) return true; } return false; } /** * Check if all cells are filled up. * @return true if Sudoku is full. */ private boolean isSudokuFull() { for (int i = 0; i < 9; i++) for (int j = 0; j < 9; j++) if (cellValues[i][j] == 0) return false; return true; } /** * Solve Sudoku recursively.
  • 12. * @param row current row index. * @param col current column index. * @return false if Sudoku is not solved. true if Sudoku is solved. */ private boolean solve(int row, int col) { // If it has passed through all cells, start quitting if (row == 9) return true; // If this cell is already set(fixed), skip to the next cell if (cellValues[row][col] != 0) { if (solve(col == 8? (row + 1): row, (col + 1) % 9)) return true; } else { // Random numbers 1 - 9 Integer[] randoms = generateRandomNumbers(); for (int i = 0; i < 9; i++) { // If no duplicates in this row, column, 3x3, assign the value and go to the next if (!isContainedInRowColumn(row, col, randoms[i]) && !isContainedIn3x3Box(row, col, randoms[i])) { cellValues[row][col] = randoms[i]; sudokuCells[row][col].setText(String.valueOf(randoms[i])); // Move to the next cell left-to-right and top-to-bottom if (solve(col == 8? (row + 1) : row, (col + 1) % 9)) return true; else { // Initialize the cell when backtracking (case when the value in the next cell was not valid) cellValues[row][col] = 0; sudokuCells[row][col].setText(""); } } } }
  • 13. return false; } /** * Generate 9 unique random numbers. * @return array containing 9 random unique numbers. */ private Integer[] generateRandomNumbers() { ArrayList randoms = new ArrayList(); for (int i = 0; i < 9; i++) randoms.add(i + 1); Collections.shuffle(randoms); return randoms.toArray(new Integer[9]); } /** * A SudokuCell represents a cell for input. * * */ private class SudokuCell extends JTextField { /** UID */ private static final long serialVersionUID = 4690751052748480438L; /** Determine if this cell can accept input. */ private boolean editable; /** * Constructor * @param row index for row of this cell. * @param col index for column of this cell. */ public SudokuCell(final int row, final int col) { super(1);
  • 14. editable = true; setBackground(Color.WHITE); setBorder(BorderFactory.createLineBorder(Color.GRAY)); setHorizontalAlignment(CENTER); setPreferredSize(new Dimension(35, 35)); setFont(new Font("Lucida Console", Font.BOLD, 28)); addFocusListener(new FocusListener(){ @Override public void focusGained(FocusEvent arg0) { // Change colors of fields located in vertical, horizontal, and 3x3 fields int startRow = row / 3 * 3; int startCol = col / 3 * 3; for (int i = 0; i < 9; i++) { // Horizontal sudokuCells[i][col].setBackground(new Color(255, 227, 209)); // Vertical sudokuCells[row][i].setBackground(new Color(255, 227, 209)); } // 3x3 box for (int i = startRow; i < startRow + 3; i++) for (int j = startCol; j < startCol + 3; j++) sudokuCells[i][j].setBackground(new Color(255, 227, 209)); } @Override public void focusLost(FocusEvent arg0) { // Set the previous color of fields back to white int startRow = row / 3 * 3; int startCol = col / 3 * 3; // Reset focus (set background color back to white) for (int i = 0; i < 9; i++) { // Horizontal sudokuCells[i][col].setBackground(Color.WHITE); // Vertical
  • 15. sudokuCells[row][i].setBackground(Color.WHITE); } // 3x3 box for (int i = startRow; i < startRow + 3; i++) for (int j = startCol; j < startCol + 3; j++) sudokuCells[i][j].setBackground(Color.WHITE); } }); addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { // Only allow numeric input if (editable) if (e.getKeyChar() >= '1' && e.getKeyChar() <= '9') { setEditable(true); setText(""); // Keep it 1 letter cellValues[row][col] = e.getKeyChar() - 48; } else if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) { setEditable(true); setText("0"); // Avoid beep sound cellValues[row][col] = 0; } else setEditable(false); // Navigation by arrow keys switch (e.getKeyCode()) { case KeyEvent.VK_DOWN: sudokuCells[(row + 1) % 9][col].requestFocusInWindow(); break; case KeyEvent.VK_RIGHT: sudokuCells[row][(col + 1) % 9].requestFocusInWindow(); break;
  • 16. case KeyEvent.VK_UP: sudokuCells[(row == 0)? 8 : (row - 1)][col].requestFocusInWindow(); break; case KeyEvent.VK_LEFT: sudokuCells[row][(col == 0)? 8 : (col - 1)].requestFocusInWindow(); break; } } }); } } /** * @param args */ public static void main(String[] args) { new SudokuSolver(); } } Solution Hi, When i just copied the code above to eclipse and tried running this is the error i get: Exception in thread "main" java.lang.NullPointerException at javax.swing.ImageIcon.(ImageIcon.java:205) at SudokuSolver.prepareSudokuUI(SudokuSolver.java:67) at SudokuSolver.(SudokuSolver.java:45) at SudokuSolver.main(SudokuSolver.java:550) That is the only error i got And the reason for the error is title.add(new JLabel(new ImageIcon(getClass().getResource("/resources/title.png")))); this perticular line in private void prepareSudokuUI() function. we should give a image file to the program so give a correct path where you have copied the image file. my suggestion is that u keep a image file in the same folder where you have this perticular .java file and just replace the path with image file name
  • 17. name. title.add(new JLabel(new ImageIcon(getClass().getResource("myimage.png")))); That will work :) if you are getting any other error you should specify in the question. Anyfurther clarification needed comment below.