//Japanese.java //generate random pseudo-japanese strings import javax.swing.*; import java.awt.*; import java.util.*; public class Japanese extends JApplet { //public void init () { public static void main (String[] argv) { JTextArea textarea = new JTextArea(10,60); textarea.setLineWrap( true ); textarea.setFont( new Font("Courier",Font.BOLD,18) ); JScrollPane scrollpane = new JScrollPane(textarea); //declare and initialize with initialization list. //size of array must not be specified. String syllables[]={ "ka","ki","ku","ke","ko", "ga","gi","gu","ge","go", "sa","si","su","se","so", "za","ji","zu","ze","zo", "ta","ti","tu","te","to", "na","ni","nu","ne","no", "ha","hi","hu","he","ho", "ba","bi","bu","be","bo", "pa","pi","pu","pe","po", "ma","mi","mu","me","mo", "ra","ri","ru","re","ro", "ya","yi","yu","ye","yo"}; String input; input = JOptionPane.showInputDialog(null, "How many random pseudo-japanese strings?", "Enter an integer", JOptionPane.QUESTION_MESSAGE); int numberWords = Integer.parseInt(input); String [] words = new String[numberWords]; input = JOptionPane.showInputDialog(null, "Maximum number of syllables per word?", "Enter an integer", JOptionPane.QUESTION_MESSAGE); int numberSyllables = Integer.parseInt(input); int allSameLength; allSameLength = JOptionPane.showConfirmDialog(null, "All same length?", "All same length?", JOptionPane.YES_NO_OPTION); int numSyls; for (int i=0; i