예제 #1
0
    @Override
    public void actionPerformed(ActionEvent arg0) {

      try {
        DbWorker dbWorker = new DbWorker();

        System.out.println(
            "first " + firstNameField.getText() + " Last: " + lastNameField.getText());

        //				rciaAdminPanel = new RciaAdminPanel(mainGui);
        //				rciaAdminPanel.displayData(dbWorker.retrieveRciaData(firstNameField.getText(),
        // lastNameField.getText()));

        // System.out.println(dbWorker.retrieveRciaData(firstNameField.getText(),
        // lastNameField.getText()));
        ArrayList<DbResult<RciaData>> dbResults =
            dbWorker.retrieveRciaData(firstNameField.getText(), lastNameField.getText());
        if (!dbResults.isEmpty()) {
          RciaTabbedPanel tabbedDisplay = new RciaTabbedPanel(dbResults);
          mainGui.setPanel(tabbedDisplay);
        } else {
          JPanel noResult = new JPanel();
          noResult.add(new JLabel("There were no matching results."));
          mainGui.setPanel(noResult);
        }
        dbWorker.dbClose();
      } catch (SQLException e1) {
        new ErrorDialog(e1);
        e1.printStackTrace();
      }
    }
예제 #2
0
    @Override
    public void actionPerformed(ActionEvent arg0) {
      try {
        DbWorker dbWorker = new DbWorker();

        //				rciaAdminPanel = new RciaAdminPanel(mainGui);
        //				rciaAdminPanel.displayData(dbWorker.retrieveRciaData("", ""));
        mainGui.setPanel(new RciaTabbedPanel(dbWorker.retrieveRciaData("", "")));

        dbWorker.dbClose();
      } catch (SQLException e1) {
        new ErrorDialog(e1);
        e1.printStackTrace();
      }
    }