// Processed by NMI's Java Code Viewer 4.8.2 © 1997-2000 B. Lemaire // Website: http://njcv.htmlplanet.com E-mail: info@njcv.htmlplanet.com // Copy registered to Evaluation Copy // Source File Name: BlankDialog.java import java.awt.*; class BlankDialog extends Frame { private Label label; private Button button; private TextField textField; private char blankType; private char ch; static int xPos; static int yPos; public BlankDialog(char c) { label = new Label("Enter value for the blank tile."); button = new Button("Done"); textField = new TextField(1); blankType = c; setLayout(new FlowLayout()); setFont(new Font("Helvetica", 0, 14)); add(label); add(textField); add(button); setResizable(false); setTitle("Value of Blank"); } public boolean action(Event event, Object obj) { if(event.target == button || event.target == textField) { String s = textField.getText().toUpperCase(); if(s.length() == 1) { ch = s.charAt(0); if(ch >= 'A' && ch <= 'Z') { if(blankType == '.') Scrabble.dotValue = s.charAt(0); if(blankType == '*') Scrabble.starValue = s.charAt(0); Board.xPos = xPos; Board.yPos = yPos; Board.selectiveUpdate = true; Scrabble.board.repaint(); dispose(); } } } return false; } }