Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

JAVA - Write a program that draws a Sudoku board with buttons, combobox on the s

ID: 3866842 • Letter: J

Question

JAVA - Write a program that draws a Sudoku board with buttons, combobox on the side, and a text area at the bottom for output messages. The board is a 9 x 9 square, (9 3x3 squares.) Each smaller square is set off by a heavier border than the regular intersquare borders. Each square is a text field. The user is able to type an integer number (range from 0-9). First level panel implemented as the Frame: embeds SudokuLavout class (a panel) Reset (button buttonPanel: gridPanel: GridLayaut(3, 0) Text Area (embeds to SudokuLayout directly) Requirements 1.) Use two classes to implement the application: an application class named “TestSudoku” and a work class named “SudokuLayout.” The SudokuLayout class (itself is a child of panel) is the first layer panel. Dimension for this panel should be (450, 350). At the bottom of the Sudoku, there is a “text area”. This gadget has certain size. Use... txtArea = new JTextArea(4, 20); add(txtArea, BorderLayout.SOUTH); The frame embeds this panel as the first level organizer. The layout managers used by each panel should be the ones indicated in the diagram. Set borders for some containers as indicated in diagram. Use two for loops to draw the text fields instead of brute-force of listing 81 text fields. It should be something like: for (int k = 1; k <= 9; k++){ JPanel level2 = new JPanel(); …. for (int i = 1; i <= 9; i++){ JTextField text = new JTextField(); … } gridPanel.add(level2); } For the Combobox, set “Hard” as its initial selected item (using program code). 2.) Add the following visual gadgets and write listeners for them. These gadgets are... ***Button “Reset”---when the button is clicked, the program will clear the text area, then output the string “Reset button clicked!” to the text area. ***Button “Hint”---when the button is clicked, the program will clear the text area, then output the string “Hint button clicked!” to the text area. Use a “text area” as an output gadget. Use a titled border to single out the gadget. The caption text is “Output Area”. The code shows how to do this and use the text area to display a message. JTextArea jtxtar = new JTextArea(30, 20); Jtxtar.setBorder(BorderFactory.creatTitledBOrder(“Output Area”)); jtxtar.setText(“Hello world!”); ***Combobox “Difficulty”---when an item is selected, the program will clear the text area, then output the selected item name to the text area. use the “setSelectedIndex()” method String[] difficulties = { “Easy”, “Medium”, “Hard” }; //Create the combo box, select item at index 1. //Indices start at 0, so 1 specifies Medium. JComboBox difficultyBox = new JComboBox(difficulties); difficultyBox.setSelectedIndex(1); To add items to the combobox, you can do one at a time, like: JComboBox jCmb = new JComboBox(); jCmb.addItem(“Hat”); Or in a batch mode String[] difficulties = { “Easy”, “Medium”, “Hard” }; JComboBox difficultyBox = new JComboBox(difficulties); 3.) Add the listeners using loosely coupled methods (private listener class or private adapter class). The borders around the game board, around the 3x3 sections, and around each individual square, are important. Follow the requirement. Show transcribed image text

Explanation / Answer

Hi I have written the code based on your requirement

the code is working fine and what i have done is

the code is very long and it is having some folders in it.

so what i have done is i have kept the entire code in google drive and

i am giving you the link of that code

so please find the sudoko game link below

https://drive.google.com/open?id=0B49dOQACyqslZE5HcGhOYTI3eWM

Hope This Helps