/** Listener to handle button actions */
 public void actionPerformed(ActionEvent e) {
   // Check if the user changed the service filter option
   if (e.getSource() == service_box) {
     service_list.setEnabled(service_box.isSelected());
     service_list.clearSelection();
     remove_service_button.setEnabled(false);
     add_service_field.setEnabled(service_box.isSelected());
     add_service_field.setText("");
     add_service_button.setEnabled(false);
   }
   // Check if the user pressed the add service button
   if ((e.getSource() == add_service_button) || (e.getSource() == add_service_field)) {
     String text = add_service_field.getText();
     if ((text != null) && (text.length() > 0)) {
       service_data.addElement(text);
       service_list.setListData(service_data);
     }
     add_service_field.setText("");
     add_service_field.requestFocus();
   }
   // Check if the user pressed the remove service button
   if (e.getSource() == remove_service_button) {
     Object[] sels = service_list.getSelectedValues();
     for (int i = 0; i < sels.length; i++) {
       service_data.removeElement(sels[i]);
     }
     service_list.setListData(service_data);
     service_list.clearSelection();
   }
 }
예제 #2
0
 void jListOnlineUsers_mouseClicked(MouseEvent e) {
   if (e.getClickCount() == 2) {
     jTextFieldTargetUser.setText(((HostItem) jListOnlineUsers.getSelectedValue()).name);
     Flasher.instance().flashBackground(jTextFieldTargetUser, Color.yellow, 2);
     jTextFieldSendMessages.requestFocus();
   }
 }
예제 #3
0
  private void myInit(SanBootView _view, Backupable _bakable, int _mode, int _type) {
    view = _view;
    bakable = _bakable;
    mode = _mode;
    type = _type;

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

    if (mode == ProfileChooser.MODE_SAVEAS || mode == ProfileChooser.MODE_SAVE) {
      saveAsProfile = new UniProfile();
      nameTextField.requestFocus();
    }
  }
예제 #4
0
 void jTextFieldSendSubject_keyPressed(KeyEvent e) {
   if (e.getKeyCode() == e.VK_DOWN) {
     String s = subjectHistory.forward();
     if (s != null) {
       jTextFieldSendSubject.setText(s);
     }
   } else if (e.getKeyCode() == e.VK_UP) {
     String s = subjectHistory.back();
     if (s != null) {
       jTextFieldSendSubject.setText(s);
     }
   } else if (e.getKeyChar() == '\n') {
     jTextFieldSendMessages.requestFocus();
   }
 }
예제 #5
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();
    }
  }
예제 #6
0
파일: BoggleGUI.java 프로젝트: nv23/Boggle
 public void setReady() {
   textField.setEditable(true);
   textField.requestFocus();
 }