Wrox Programmer Forums
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 15th, 2010, 01:35 PM
Registered User
 
Join Date: Apr 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default sudoku GUI

PHP Code:
    private JPanel lagBrettet() {
        
int toppvenstre;
        
JPanel brettPanel = new JPanel();
        
brettPanel.setLayout(new GridLayout(dimensjon,dimensjon));
        
brettPanel.setAlignmentX(CENTER_ALIGNMENT);
        
brettPanel.setAlignmentY(CENTER_ALIGNMENT);
        
setPreferredSize(new Dimension(new Dimension(dimensjon RUTE_STRELSE,
                        
dimensjon RUTE_STRELSE)));


        for(
int i 0dimensjoni++) {
            
/* finn ut om denne raden trenger en tykker linje pÃ¥ toppen: */
            
topp = (vertikalAntall == && != 0) ? 1;
            for(
int j 0dimensjonj++) {
                
/* finn ut om denne ruten er en del av en kolonne 
                   som skal ha en tykkere linje til venstre:       */
                
venstre = (horisontalAntall == && != 0) ? 1;

                
JTextField ruten = new JTextField();
                
ruten.setBorder(BorderFactory.createMatteBorder
                        
(topp,venstre,1,1Color.black));
                
ruten.setHorizontalAlignment(SwingConstants.CENTER);
                
ruten.setPreferredSize(new Dimension(RUTE_STRELSERUTE_STRELSE));
                
ruten.setText("A");
                
brett[i][j] = ruten;
                
brettPanel.add(ruten);
            }
        }
        return 
brettPanel;
    } 
How can I update the Sudoku with new numbers (instead og A)?
Validate?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sudoku solver aehb Visual C++ 3 November 12th, 2011 07:41 AM
I'm here for the GUI OldCProgrammer BOOK: Beginning Python: Using Python 2.6 and Python 3.1 1 April 26th, 2010 03:29 PM
Sudoku lldonn XSLT 1 October 12th, 2007 09:53 AM
GUI questions hlchuah77 Java GUI 2 August 24th, 2004 09:23 AM
help in GUI khfarooq Java GUI 5 August 22nd, 2004 05:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.