Package javax.swing.event

Examples of javax.swing.event.ListSelectionListener


            table = new JTable();
            table.setModel(getModel());
            table.setSelectionModel(lsm);
            table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

            lsm.addListSelectionListener(new ListSelectionListener() {
                public void valueChanged(ListSelectionEvent e) {
                    // Ignore extra messages.
                    if (e.getValueIsAdjusting()) {
                        return;
                    }
View Full Code Here


        JTable table = new JTable(model);
        JScrollPane pane = new JScrollPane(table);
        frame.getContentPane().add(pane, BorderLayout.CENTER);

        ListSelectionModel lsm = table.getSelectionModel();
        lsm.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                //Ignore extra messages.
                if (e.getValueIsAdjusting()) {
                    return;
                }
View Full Code Here

    chooser.setSelectedIndex(0);
    chooser.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    // Add the selection listener that will show the correct panel when
    // selection changes:
    chooser.addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        if (e.getValueIsAdjusting())
          return;
        String o = (String) chooser.getSelectedValue();
        cardLayout.show(main, o);
View Full Code Here

      };
      JTable table = new JTable(dataModel);

      table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
      ListSelectionModel rowSM = table.getSelectionModel();
      rowSM.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
          //Ignore extra messages.
          if (e.getValueIsAdjusting()) return;
       
          ListSelectionModel lsm = (ListSelectionModel)e.getSource();
View Full Code Here

        tlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tlist.setVisibleRowCount(5);
        JScrollPane tlistScrollPane = new JScrollPane(tlist);
        content.add(tlistScrollPane, BorderLayout.WEST);

        tlist.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                create.setEnabled(tlist.getSelectedValue() != null);
            }
        });
View Full Code Here

                            TreeNode tn = (TreeNode) (st.getSelectionPath().getLastPathComponent());
                            ((DefaultTreeModel) (st.getModel())).nodeChanged(tn);
                        }
                    }
                });
                list.addListSelectionListener(new ListSelectionListener() {
                    public void valueChanged(ListSelectionEvent e) {
                        Object sel = list.getSelectedValue();
                        if (sel == null) {
                            return;
                        }
View Full Code Here

                }
            }
        });
        cmDuplicate.setEnabled(false);
       
        cmlist.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                cmDelete.setEnabled(cmlist.getSelectedValue() != null);
                cmDuplicate.setEnabled(cmlist.getSelectedValue() != null);
                updateWarnings();
            }
View Full Code Here

        if (name.equals("")) name = null;
        actionListener.actionPerformed(new ActionEvent(pane, 1, (name==null) ? resources.getString("UnnamedMapper") : name));
      }
    });

    table.addSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent event) {
        int r = table.getSelectedRow();
        if (r==-1) {
          del.setEnabled(false);
          up.setEnabled(false);
View Full Code Here

       
        add(definitionBox, BorderLayout.CENTER);

        setListButtonState();
       
        list.addListSelectionListener(new ListSelectionListener() {
          public void valueChanged(ListSelectionEvent e) {
            int sel = list.getSelectedIndex();
            if (sel==-1) currentAction = createNewAction();
            else currentAction = actionList.getAction(list.getSelectedIndex());
            setListButtonState();
View Full Code Here

            }
        });
        cmDuplicate.setEnabled(false);


        cmlist.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                cmDelete.setEnabled(cmlist.getSelectedValue() != null);
                cmDuplicate.setEnabled(cmlist.getSelectedValue() != null);
                updateWarnings();
            }
View Full Code Here

TOP

Related Classes of javax.swing.event.ListSelectionListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.