コード例 #1
0
 public RandomUser fetchRandomUser() {
   RandomUser user = null;
   try {
     user = RandomUserGenerator.getRandomUser();
   } catch (InterruptedException ex) {
     Logger.getLogger(RandomUserControl.class.getName()).log(Level.SEVERE, null, ex);
   }
   return user;
 }
コード例 #2
0
  public void fetchRandomUser() {

    RandomUser user = null;
    try {
      user = RandomUserGenerator.getRandomUser();
    } catch (InterruptedException ex) {
      Logger.getLogger(RandomUserControl.class.getName()).log(Level.SEVERE, null, ex);
    }
    setChanged();
    notifyObservers(user);
  }
コード例 #3
0
  public void run() {
    RandomUser user = null;

    try {
      user = RandomUserGenerator.getRandomUser();
    } catch (InterruptedException ex) {
      Logger.getLogger(RandomUserControl.class.getName()).log(Level.SEVERE, null, ex);
    }

    RandomUserControl control = new RandomUserControl();
    control.updateObservers(user);
  }