>230 while (true) { /* * Get user's search term -- this is what the user wants to search * for in the file. */ String key = javax.swing.JOptionPane.showInputDialog("Enter a search term:"); /* * If the user clicks on the "Cancel" button, key will be null. */ if( key == null ) { System.out.println("Stop Serching."); break; } /* * Check if the user clicked on the "OK" button without entering any * text for the key */ if( key.length() == 0 ) { System.out.println( "Enter any characters." ); break; } System.out.println("Searching for " + key + "..."); // 後略