javax.swing.DefaultListModel#addListDataListener ( )源码实例Demo

下面列出了javax.swing.DefaultListModel#addListDataListener ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans   文件: PathsCustomizer.java
public void setModels(final DefaultListModel mpModel, final DefaultListModel cpModel) {
    this.model = new JoinModel(mpModel, cpModel);
    this.list.setModel(this.model);
    DefaultTreeModel mpTreeModel = toTreeModel(mpModel, MODULEPATH);
    DefaultTreeModel cpTreeModel = toTreeModel(cpModel, CLASSPATH);
    mpModel.addListDataListener(new ListModelListener(mpModel, mpTreeModel, mpTree));
    cpModel.addListDataListener(new ListModelListener(cpModel, cpTreeModel, cpTree));
    mpTree.setModel(mpTreeModel);
    cpTree.setModel(cpTreeModel);
    SelectionModel mpTreeSelectionModel = new SelectionModel();
    SelectionModel cpTreeSelectionModel = new SelectionModel();
    mpTreeSelectionModel.addTreeSelectionListener(new SelectionListener(mpTreeModel, this.list, null, cpTreeSelectionModel));
    cpTreeSelectionModel.addTreeSelectionListener(new SelectionListener(cpTreeModel, this.list, mpModel, mpTreeSelectionModel));
    mpTree.setSelectionModel(mpTreeSelectionModel);
    cpTree.setSelectionModel(cpTreeSelectionModel);
}
 
源代码2 项目: netbeans   文件: PathsCustomizer.java
public void setModels(final DefaultListModel mpModel, final DefaultListModel cpModel) {
    this.model = new JoinModel(mpModel, cpModel);
    this.list.setModel(this.model);
    DefaultTreeModel mpTreeModel = toTreeModel(mpModel, MODULEPATH);
    DefaultTreeModel cpTreeModel = toTreeModel(cpModel, CLASSPATH);
    mpModel.addListDataListener(new ListModelListener(mpModel, mpTreeModel, mpTree));
    cpModel.addListDataListener(new ListModelListener(cpModel, cpTreeModel, cpTree));
    mpTree.setModel(mpTreeModel);
    cpTree.setModel(cpTreeModel);
    SelectionModel mpTreeSelectionModel = new SelectionModel();
    SelectionModel cpTreeSelectionModel = new SelectionModel();
    mpTreeSelectionModel.addTreeSelectionListener(new SelectionListener(mpTreeModel, this.list, null, cpTreeSelectionModel));
    cpTreeSelectionModel.addTreeSelectionListener(new SelectionListener(cpTreeModel, this.list, mpModel, mpTreeSelectionModel));
    mpTree.setSelectionModel(mpTreeSelectionModel);
    cpTree.setSelectionModel(cpTreeSelectionModel);
}
 
源代码3 项目: visualvm   文件: PathController.java
/** Creates a new instance of PathController */
public PathController(JList l, JLabel label, DefaultListModel model, JButton add, JFileChooser chooser, JButton remove, JButton up, JButton down, ListDataListener lstnr) {
    this.l = l;
    this.label = label;
    this.model = model;
    this.add = add;
    this.remove = remove;
    this.up = up;
    this.down = down;
    this.chooser = chooser;

    this.lstnr = lstnr;

    l.setModel(model);
    if (model != null) {
        model.addListDataListener(this);
    }
    add.setActionCommand("add");// NOI18N
    remove.setActionCommand("remove");// NOI18N
    up.setActionCommand("up");// NOI18N
    down.setActionCommand("down");// NOI18N
    add.addActionListener(this);
    remove.addActionListener(this);
    up.addActionListener(this);
    down.addActionListener(this);
    l.addListSelectionListener(this);

    remove.setEnabled(false);
    up.setEnabled(false);
    down.setEnabled(false);
}
 
源代码4 项目: netbeans   文件: ClassPathTableModel.java
public ClassPathTableModel(DefaultListModel model) {
    super();
    this.model = model;
    model.addListDataListener(this);
}
 
源代码5 项目: netbeans   文件: AdditionalContentTableModel.java
public AdditionalContentTableModel(DefaultListModel model) {
    super();
    this.model = model;
    model.addListDataListener(this);
}
 
源代码6 项目: netbeans   文件: ClassPathTableModel.java
public ClassPathTableModel(DefaultListModel model) {
    super();
    this.model = model;
    model.addListDataListener(this);
}
 
源代码7 项目: netbeans   文件: WarIncludesTableModel.java
public WarIncludesTableModel(DefaultListModel model) {
    super();
    this.model = model;
    model.addListDataListener(this);
}
 
源代码8 项目: netbeans   文件: FormBeanPropertiesPanelVisual.java
public PropertiesTableModel() {
    model = new DefaultListModel();
    model.addListDataListener(this);
}
 
源代码9 项目: netbeans   文件: ClassPathTableModel.java
public ClassPathTableModel(DefaultListModel model) {
    super();
    this.model = model;
    model.addListDataListener(this);
}