922 Files and Streams Chapter 16 18 19 (Affordable web design)
922 Files and Streams Chapter 16 18 19 public class CreditInquiry extends JFrame { 20 private JTextArea recordDisplayArea; 21 private JButton openButton, 22 creditButton, debitButton, zeroButton; 23 private JPanel buttonPanel; 24 25 private ObjectInputStream input; 26 private FileInputStream fileInput; 27 private File fileName; 28 private String accountType; 29 30 // set up GUI 31 public CreditInquiry() 32 { 33 super( “Credit Inquiry Program” ); 34 35 Container container = getContentPane(); 36 37 // set up panel for buttons 38 buttonPanel = new JPanel(); 39 40 // create and configure button to open file 41 openButton = new JButton( “Open File” ); 42 buttonPanel.add( openButton ); 43 44 // register openButton listener 45 openButton.addActionListener( 46 47 // anonymous inner class to handle openButton event 48 new ActionListener() { 49 50 // open file for processing 51 public void actionPerformed( ActionEvent event ) 52 { 53 openFile( true ); 54 } 55 56 } // end anonymous inner class 57 58 ); // end call to addActionListener 59 60 // create and configure button to get 61 // accounts with credit balances 62 creditButton = new JButton( “Credit balances” ); 63 buttonPanel.add( creditButton ); 64 creditButton.addActionListener( new ButtonHandler() ); 65 66 // create and configure button to get 67 // accounts with debit balances 68 debitButton = new JButton( “Debit balances” ); 69 buttonPanel.add( debitButton ); 70 debitButton.addActionListener( new ButtonHandler() ); Fig. 16.9Credit inquiry program (part 2 of 7). Fig. 16.9
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.