Need *Help fixing this 3 Answer(s) 3 years and 9 months ago
Posted in : Java Beginners
View Answers
August 18, 2009 at 11:53 AM
Hi Friend,
We are providing you the code that will first prompt the user to enter username and password and if they input correct username and password then they will move to next page i.e Pool Form.
class clearButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e){ length.setText(""); width.setText(""); average.setText(""); volume.setText(""); length.grabFocus(); } }
class exitButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e){ System.exit(0); } }
class saveButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e){ String value=volume.getText(); try{ File file = new File("output.txt"); FileWriter fstream = new FileWriter(file,true); BufferedWriter out = new BufferedWriter(fstream); out.write("The volume of Swimming Pool is "+value); out.newLine(); out.close(); } catch(Exception ex){} } }
class FocusHandler implements FocusListener { public void focusGained(FocusEvent e) { } public void focusLost(FocusEvent e) { } } public static void main(String args[]){ new PoolVolume(); } }