コード例 #1
0
ファイル: MainWindow.java プロジェクト: kornicameister/Mabis
 private void checkForUsers() {
   // check for any user, if none print NewUserDialog
   UserSQLFactory f = new UserSQLFactory(SQLStamentType.SELECT, new User());
   try {
     f.executeSQL(true);
   } catch (SQLException | SQLEntityExistsException e) {
     e.printStackTrace();
   }
   if (!f.getUsers().isEmpty()) {
     UserSelectionPanel usp = new UserSelectionPanel(f.getUsers(), this);
     usp.setVisible(true);
     usp.setAlwaysOnTop(true);
     usp = null;
   } else {
     int retVal =
         JOptionPane.showConfirmDialog(this, "No users found\nWould like to create new user ?");
     if (retVal == JOptionPane.OK_OPTION) {
       NewUserDialog newUser = new NewUserDialog(this, true);
       newUser.setVisible(true);
     }
   }
   System.gc();
 }