Cheapest web hosting - Chapter 20 Java Utilities Package and Bit Manipulation
Chapter 20 Java Utilities Package and Bit Manipulation 1165 133 134 // button to detetmine whether hash table is empty 135 JButton emptyButton = new JButton( “Empty” ); 136 137 emptyButton.addActionListener( 138 139 new ActionListener() { 140 141 // determine whether hash table is empty 142 public void actionPerformed( ActionEvent event ) 143 { 144 statusLabel.setText( “Empty: ” + table.isEmpty() ); 145 } 146 } 147 ); 148 149 southPanel.add( emptyButton ); 150 151 // button to determine whether hash table contains key 152 JButton containsKeyButton = new JButton( “Contains key” ); 153 154 containsKeyButton.addActionListener( 155 156 new ActionListener() { 157 158 // determine whether hash table contains key 159 public void actionPerformed( ActionEvent event ) 160 { 161 statusLabel.setText( “Contains key: ” + 162 table.containsKey( lastNameField.getText() ) ); 163 } 164 } 165 ); 166 167 southPanel.add( containsKeyButton ); 168 169 // button to clear all hash table contents 170 JButton clearButton = new JButton( “Clear table” ); 171 172 clearButton.addActionListener( 173 174 new ActionListener() { 175 176 // clear hash table contents 177 public void actionPerformed( ActionEvent event ) 178 { 179 table.clear(); 180 statusLabel.setText( “Clear: Table is now empty” ); 181 } 182 } 183 ); 184 185 southPanel.add( clearButton ); Fig. 20.3 Demonstrating class Hashtable(part 4 of 6).
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services