コード例 #1
4
 /** 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
ファイル: GraphDisplay.java プロジェクト: hiralv/TableViewNew
 /**
  * Remove the graph item from the graph.
  *
  * @param graphItem Item to be removed from the graph.
  */
 public void removeGraphItem(GraphItem graphItem) {
   graphItems.removeElement(graphItem);
   graphItem.removeGraphItemListener(graphItemListener);
   repaint();
 }
コード例 #3
0
ファイル: DataContainer.java プロジェクト: rakyll/plantuml
 /** Removes a {@link DataListener}. Does nothing if already removed. */
 public void removeDataListener(DataListener listener) {
   _listeners.removeElement(listener);
 }