FileDocCategorySizeDatePackage
DatabaseTest.javaAPI DocExample1367Thu Oct 24 20:14:24 BST 2002None

DatabaseTest

public class DatabaseTest extends JFrame

Fields Summary
JTextField
hostField
JTextField
queryField
QueryTableModel
qtm
Constructors Summary
public DatabaseTest()

    super("Database Test Frame");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setSize(350, 200);

    qtm = new QueryTableModel();
    JTable table = new JTable(qtm);
    JScrollPane scrollpane = new JScrollPane(table);
    JPanel p1 = new JPanel();
    p1.setLayout(new GridLayout(3, 2));
    p1.add(new JLabel("Enter the Host URL: "));
    p1.add(hostField = new JTextField());
    p1.add(new JLabel("Enter your query: "));
    p1.add(queryField = new JTextField());
    p1.add(new JLabel("Click here to send: "));

    JButton jb = new JButton("Search");
    jb.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        qtm.setHostURL(hostField.getText().trim());
        qtm.setQuery(queryField.getText().trim());
      }
    } );
    p1.add(jb);
    getContentPane().add(p1, BorderLayout.NORTH);
    getContentPane().add(scrollpane, BorderLayout.CENTER);
  
Methods Summary
public static voidmain(java.lang.String[] args)

    DatabaseTest tt = new DatabaseTest();
    tt.setVisible(true);