%BROADCASTMESSAGE%
CAAD | ARCH TWiki > Catch0405 > KaisersrotPersistenz > SoftwareVersions > GenerischeDb-Eingabemaske > GuiPgm TWiki webs:
Admin| Aizo | Archinf | BIP | Bgyalex | Brandhub | Catch0405 | Cityscan05 | CommunityMedia | Control | Curtain | Easa005 | Easydb | Education | Extern | Extern0405 | Freudenhaus | Fund | Game0405 | Game05 | Gamearch | Luise | MAS0506 | MAS0506stu | Mas0506 | Mas0506stu | Maschinen0405 | Menz | Mill | Mill0405 | NDS | NDS0405 | NDS0405stu | Plugins | Qwipp | RZM | Replay | Replay0405 | Research | Second | Trash | Udintern | Urbandesign |
Catch0405 . { Changes | Index | Search | Go }
/*
 * Created on Dec 6, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */



import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


import javax.swing.*;


   
   public class DataInputGui implements ActionListener { 
 
      
      String returnMsg;
      JTextField textField1 = new JTextField(20);
      JTextField textField2 = new JTextField(20);
      JTextField textField3 = new JTextField(20);
      JTextField textField4 = new JTextField(20);
      JTextField returnField = new JTextField(40);
      
       public DataInputGui() {
         
         JLabel label1 = new JLabel("Label-1");
         JLabel label2 = new JLabel("Label-2");
         JLabel label3 = new JLabel("Label-3");
         JLabel label4 = new JLabel("Label-4");
                                                          
           //Create and set up the window.
           JFrame frame = new JFrame("generisches gui");
           frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           JFrame.setDefaultLookAndFeelDecorated(true);

           JPanel panel = new JPanel();
           frame.getContentPane().add(panel);          
         panel.setLayout(new GridLayout(6,2));
                   
           JButton saveDataButton = new JButton("save data now");
           saveDataButton.addActionListener(this);
           panel.add(saveDataButton);
                                                                                    
         JLabel label = new JLabel("    inputfields :");
         panel.add(label);
                                 
         panel.add(label1);                        
          panel.add(textField1);
          
          panel.add(label2);                        
          panel.add(textField2);
          
          panel.add(label3);                        
          panel.add(textField3);
          
          panel.add(label4);                        
          panel.add(textField4);
          
          JLabel returnStatus = new JLabel("return status: ");
          panel.add (returnStatus);
          panel.add (returnField);
                    
           //Display the window.
           frame.pack();
           frame.setSize(500,200);   
           frame.setVisible(true);
           
       }
       
       public void actionPerformed(ActionEvent e) {
       
           System.out.println("textField1 :" + textField1.getText());
           System.out.println("textField2 :" + textField2.getText());
           System.out.println("textField3 :" + textField3.getText());
           System.out.println("textField4 :" + textField4.getText());
           
          String [] array = {textField1.getText(),
                           textField2.getText(),
                               textField3.getText(),
                               textField4.getText()};
          
           StoreData storeData = new StoreData();
           returnMsg = storeData.store(array);
           returnField.setText(returnMsg);
           textField1.setText("");
           textField2.setText("");
           textField3.setText("");
           textField4.setText("");           
      }                     
   }

-- OtherDenisRaschpichler - 14 Dec 2004


Topic GuiPgm . { Edit | Attach | Ref-By | Printable | Diffs | r1.1 | More }

Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

This website has been archived and is no longer maintained.