This JavaFX app wasn't exactly spotted in the wild, but rather is an example that I developed for the JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications book. To invoke it, use this Java Web Start link. Remember, you'll need JRE 1.5 or later on your computer.
Overview of the Word Search Builder Application
The word search builder application is a tool for creating word search puzzles. The user enters words into a word list and places these words on a word grid. Each word can be placed at a specific location and orientation (horizontal, vertical, diagonal up, or diagonal down) on the grid. Alternatively, words can be placed in random locations and orientations. When a word is on the word grid it can be dragged to other locations on the grid and its orientation can be changed as well.
The screenshot below shows the application when it first starts up. Notice that it has a menu, a toolbar, a word grid on the left side, and a couple of list boxes on the right side. The upper list box contains the unplaced words, which are the words in the word list that haven’t yet been placed on the word grid. The lower list box contains the words that have already been placed.
A Tour of the Application
To add a word to the Unplaced Words list, you can do one of several things:
- Select the WordList ➤ Add Word option.
- Click the rightmost toolbar button.
- Press the Insert key (if your machine has one).
Any of those actions will produce the dialog box shown in the screenshot below, in which you can enter a word and click the OK button (or press the Enter key).
After adding the names of the eight planets in our solar system (sorry Pluto), the Unplaced Words list box should have the appearance shown below:
To place a word on the grid at a location and orientation of your choosing, either select the Grid ➤ Place Word menu option, or click the leftmost toolbar button. You should see the dialog box shown below, in which you can choose a starting row, starting column, and word orientation:
After placing the first two planets in this manner, the application has the appearance shown below, where the words are in the word grid as well as in the Placed Words list box:
To place a word randomly on the grid, select that word in the Unplaced Words list box and select the Grid ➤ Place Word Randomly menu option. Most of the menu options have accelerator (shortcut) keys, which you can see when dropping down a menu. For example, this option can also be invoked via the Ctrl+R accelerator keystroke combination. Yet another way to invoke this option is to double-click the word to be placed in the Unplaced Words list. Any way you invoke it, the result is a dialog box asking you to confirm that you really want to place the word, as shown below:
To place all of the remaining words randomly, select the Grid ➤ Place All Words Randomly menu option. After clicking OK on a dialog that asks you to confirm that you want to place all the words, all the words will be placed on the grid, and will also appear in the Placed Words list box. If you roll the cursor over a letter in the word grid, the associated words will be highlighted in yellow. If you right-click the mouse on a letter (or click the mouse while holding the Ctrl key down), a menu enabling you to unplace the words pops up, as shown below:
To fill the remaining cells on the grid with random letters, select the Grid ➤ Show Fill Letters menu option, or press the Ctrl+F key combination. The word grid should appear, similar to what is shown in the screenshot below:
When the fill letters are on the grid, most of the application functionality is disabled, so if you drop down the grid menu, most of the menu options will be grayed out. Note that three of the toolbar buttons are disabled as well.
Selecting the Grid ➤ Show Fill Letters menu option again (or pressing Ctrl+F) will remove the fill letters from the grid.
To drag a word from one place on the grid to another, click and drag the first letter of a word. The background for the word being dragged changes to cyan and the cursor becomes a hand icon when a word can be placed in the current location. See the screenshot below for an example of this behavior, where MARS is being dragged to intersect with the M in MERCURY.
When the word is being dragged to a location where it can’t be placed, the background for the word changes to red and the cursor changes to one that means move (see the screenshot below).
The orientation of a word on the grid can be changed by holding the Shift key down while clicking the first letter of the word. With each click, the word will cycle through each available orientation, pivoting on the first letter of the word. The screenshot below shows the orientation of VENUS being changed from diagonal down to vertical, pivoting on the letter V:
In addition to using the pop-up menu shown earlier to remove a word from the grid, you can select a word in the Placed Words list box and select the Grid ➤ Unplace Word menu option. Another alternative is to double-click a word in the Placed Words list box. In both cases, you’ll be prompted to confirm the operation.
Finally, to unplace all the words from the grid, select the Grid ➤ Unplace All Words menu option, or use the Alt+U accelerator key combination. Again, you’ll be prompted to confirm the operation.
I didn't build any print functionality into this example application, but if you want to use it to generate word search puzzles on paper just take a screenshot of your puzzle and print the screenshot.
Enjoy!
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
What makes word pictures work is not so much constructing complex or poetic words, rather it is putting everyday words together to describe something in a way the listener can see and feel. It's allowing your listener to "experience" the words, not just hear them.
Posted by: buy kamagra | April 27, 2010 at 04:07 PM