Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Making a sudoku game, seeking help

  1. #1
    Junior Member
    Join Date
    Aug 2017
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Making a sudoku game, seeking help

    I'm building a sudoku game. Eventually I want the numbers to randomize in the beginning of each game. For now I simply want a preset board. This is the code I have been playing with to make the gui:

    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    package newestlatestgui;
     
    import java.awt.*;
    import java.awt.event.*;
     
     
     
    public class NewestLatestGui extends Frame implements WindowListener {
     
        public GridLayout() {
            super("GridLayout");
            addWindowListener(this);
            setLayout(new GridLayout(0, 3, 5, 10));
     
            for (int b=1; b <= 9; b++) {
                add(new Button("Button " + b));
            }
     
            pack();
            setVisible(true);
     
        }
     
        public static void main(String args[]) {
            GridLayoutTest glt = new GridLayoutTest();
        }
     
     
     
    }

    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    package newestlatestgui;
     
     
    import java.awt.*;
    import java.awt.event.*;
     
    public class SimpleFrameTest {
     
     public static void main(String argsp[]) {
            Frame frame = new Frame("Simple Frame Test");
            frame.setSize(900, 900);
            frame.setVisible(true);
     
            frame.addWindowListener(new WindowAdapter() {
                @Override
                public void windowClosing(WindowEvent e) {
                    // Dispose the window after the close button is clicked.
                    frame.dispose();
                }
            });
        }
    }

    Any suggestions on how to program this?

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,165
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Making a sudoku game, seeking help

    Use a more modern set of classes like Swing instead of AWT.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Making a 3D Game?
    By MitchWardle in forum Java Theory & Questions
    Replies: 0
    Last Post: March 25th, 2013, 12:35 PM
  2. Making a New Game Help
    By AndyLun in forum Java Code Snippets and Tutorials
    Replies: 2
    Last Post: December 5th, 2012, 03:25 AM
  3. Help with turning Sudoku into Magic Sudoku
    By Murlio in forum Java Theory & Questions
    Replies: 1
    Last Post: November 4th, 2012, 02:49 PM
  4. Replies: 6
    Last Post: February 21st, 2012, 09:41 PM
  5. Making a Craps game.
    By SOK in forum Object Oriented Programming
    Replies: 1
    Last Post: March 6th, 2010, 08:23 PM