// Primes.java // Find all primes up to user-specified limit. import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; public class Primes extends JApplet { JTextField testNumField; JLabel primeLabel; JTextField firstNField; JTextField countField; JTextArea listArea; public void init() { JLabel testNumLabel; JLabel firstNLabel; JLabel countLabel; Container container = getContentPane(); int panelRowsSize = 3; container.setLayout( new GridLayout( panelRowsSize, 1 ) ); //container.setLayout( new FlowLayout( ) ); JPanel [] panelRows = new JPanel[panelRowsSize]; for (int i=0; i>var_num_shift) & 1) == 0 ) b = Boolean.valueOf( false ); else b = Boolean.valueOf( true ); table.put( (String)iter.next(), b ); ttArea.append(" " + ((row>>var_num_shift)&1)); var_num_shift--; } ttArea.append( " " ); index = 0; while ( index < input.length() ) { get_token(); if (curr_tok == END) break; if (curr_tok == PRINT) continue; ttArea.append( expr( false ) + "\n" ); } } } } ); ttArea = new JTextArea( 10, 20 ); JScrollPane ttScroll = new JScrollPane( ttArea ); panelRows[1].add( ttScroll ); clearButton = new JButton( "Clear" ); panelRows[2].add( clearButton ); clearButton.addActionListener( new ActionListener () { public void actionPerformed( ActionEvent event ) { inputField.setText( "" ); errorLabel.setText( "" ); ttArea.setText( "" ); inputField.requestFocusInWindow(); } } ); errorLabel = new JLabel( "" ); panelRows[2].add( errorLabel ); } */