JavaFX - Sudoku with CSS
By Rakesh Menon on Mar 10, 2009
This is a Sudoku game developed using JavaFX. The objective is not really to demonstrate Sudoku, but to show Cascading Style Sheets (CSS) support in JavaFX. This sample uses two CSS files - blue.css and black.css. These files have information about different user interface attributes such as color, font, shape...
<script src="http://dl.javafx.com/1.1/dtfx.js"></script><script src="/rakeshmenonp/resource/Sudoku/Sudoku.js"></script>
For Applet mode, click on above image
First lets create a style sheet...
Similarly a button can be created by a combination of Rectangle and Text as shown below:
Now we need to associate this style-sheet with the top level container of JavaFX - Scene.
stylesheetand have assigned the URL of the stylesheet file. Now I bind this value to
Scene. This will associate the CSS file with this Scene. I have used
bindso that I can update the associated stylesheet at runtime.
Now I will associate the style-class defined in style-sheet to the specified Node. For example, we can apply the
titleText style-class with the title node as shown below.
Similarly we can associate the button's rectangle attributes as shown below..