import javax.swing.JOptionPane; public class ScrabbleGUIDemo { public static void main( String[] args ) { Scrabble scrabble = new Scrabble(); while (true) { String word = JOptionPane.showInputDialog("Enter word: "); if( word == null ) { break; } if( !word.isEmpty() ) { int wordValue = scrabble.evaluateWord(word); JOptionPane.showMessageDialog( null, word + " " + wordValue); } } } }