Beispiel #1
0
 /**
  * Logs in user, eventually
  *
  * @param username
  * @param password
  */
 public static Boolean login(String username, String password) {
   Boolean status;
   if (username.equals("sigve") && password.equals("1337")) {
     setUser(User.getUser(1)); // get user 1 for now
     GregorianCalendar now = new GregorianCalendar(2012, 3, 23); // arbitrary date for now
     System.out.println("User logged in");
     pushView(new CalendarView());
     Client.setNotifications(Message.getMessages(Client.user));
     Client.setActiveWeek(
         now.get(GregorianCalendar.YEAR),
         now.get(GregorianCalendar.MONTH),
         now.get(GregorianCalendar.DATE));
     status = true;
   } else {
     System.out.println("Wrong username and/or password");
     status = false;
   }
   return status;
 }
Beispiel #2
0
 /**
  * makes a new Calendar, pushes to stack, and makes it visible
  *
  * @throws IOException
  * @throws ConnectException
  * @throws ClassNotFoundException
  * @see#viewStack
  */
 public static void main(String[] args)
     throws ConnectException, IOException, ClassNotFoundException {
   calendar = new Client();
   pushView(new LoginView());
   calendar.setVisible(true);
 }