Exemple #1
0
 void profileList_mouseClicked(MouseEvent e) {
   JList theList = (JList) e.getSource();
   ListModel aModel = theList.getModel();
   int index = theList.locationToIndex(e.getPoint());
   if (index < 0) return;
   UniProfile aProfile = (UniProfile) aModel.getElementAt(index);
   nameTextField.setText(aProfile.toString());
 }
Exemple #2
0
  private void myInit2(
      SanBootView _view, Backupable _bakable, int _mode, int _type, BootHost host) {
    view = _view;
    bakable = _bakable;
    mode = _mode;
    type = _type;

    setupProfileType();
    setupList();
    setupLanguage();

    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss");
    Date date = new Date();
    String time = df.format(date);
    System.out.println(host.getID() + "-" + time);
    nameTextField.setText(host.getID() + "-" + time);

    if (mode == ProfileChooser.MODE_SAVEAS || mode == ProfileChooser.MODE_SAVE) {
      saveAsProfile = new UniProfile();
      nameTextField.requestFocus();
    }
  }