Package javax.swing.event

Examples of javax.swing.event.ListSelectionListener


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


     EXIT_ON_CLOSE should be defined in the interface javax.swing.WindowConstants
     but it isn't.
     The value is set to 3, therefore we set it hard here.
     */
     this.setDefaultCloseOperation(3);
     jList1.addListSelectionListener(new ListSelectionListener() {
         public void valueChanged(ListSelectionEvent evt) {
            JList source = (JList) evt.getSource();
            MessageWrapper selection = (MessageWrapper) source.getSelectedValue();
            if (selection != null) {
               String secretCallbackSessionId = selection.getSecretCallbackSessionId();
View Full Code Here

  private JList getEntryList() {
    if (entryList == null) {
      entryList = new JList(getEntryListModel());
      entryList.setDragEnabled(true);
      entryList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
      entryList.addListSelectionListener(new ListSelectionListener() {

        public void valueChanged(ListSelectionEvent e)
        {
          if (!e.getValueIsAdjusting())
            updateDetailsPane(entryList.getSelectedIndex(), entryList.getSelectedValue());
View Full Code Here

         }
      });
      _popUp.add(mnuAppendSelectionToEditor);


      _dlg.tblHistoryItems.getSelectionModel().addListSelectionListener(new ListSelectionListener()
      {
         public void valueChanged(ListSelectionEvent e)
         {
            onTblSelectionChanged(e);
         }
View Full Code Here

        panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        // table
        resultsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        ListSelectionModel rowSL = resultsTable.getSelectionModel();
        rowSL.addListSelectionListener(
            new ListSelectionListener()
            {
                public void valueChanged(ListSelectionEvent e)
                {
                    // ignora extra values
                    if(e.getValueIsAdjusting())
View Full Code Here

   private int[] _formerSelectedIxs = new int[0];

   public DataSetViewerTableListSelectionHandler(DataSetViewerTablePanel.MyJTable table)
   {
      _table = table;
      _table.getSelectionModel().addListSelectionListener(new ListSelectionListener()
      {
         @Override
         public void valueChanged(ListSelectionEvent e)
         {
            fireListeners(_formerSelectedIxs, _table.getSelectedRows());
View Full Code Here

    }


    private void setupActions() {

  wordList.addListSelectionListener(new ListSelectionListener() {
    public void valueChanged(ListSelectionEvent e) {
        wordEditField.setText((String)wordList.getSelectedValue());
        wordEditField.selectAll();
        new FocusRequester(wordEditField);
    }
      });

  newWord.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
        newWordAction();
    }
      });
               
        wordEditFieldListener = new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                int index = wordList.getSelectedIndex();
                String old = (String)wordList.getSelectedValue(),
              newVal = wordEditField.getText();
                if (newVal.equals("") || newVal.equals(old))
                    return; // Empty string or no change.
                int newIndex = findPos(wordListModel, newVal);
                if (index >= 0) {
                    wordListModel.remove(index);
                    wordListModel.add((newIndex <= index ? newIndex : newIndex-1),
                      newVal);
                } else
                    wordListModel.add(newIndex, newVal);
       
                wordEditField.selectAll();
            }
  };
        wordEditField.addActionListener(wordEditFieldListener);
       
  removeWord.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
        int index = wordList.getSelectedIndex();
        if (index == -1)
      return;
        wordListModel.remove(index);
        wordEditField.setText("");
        if (wordListModel.size() > 0)
      wordList.setSelectedIndex(Math.min(index, wordListModel.size()-1));
    }
      });


  fieldList.addListSelectionListener(new ListSelectionListener() {
    public void valueChanged(ListSelectionEvent e) {
        currentField = (String)fieldList.getSelectedValue();
        fieldNameField.setText("");
        setupWordSelector();
    }
View Full Code Here

    table.getTableHeader().setReorderingAllowed(false);
    //assign selection model for row selection and for column selection
    table.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    table.getColumnModel().getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        try {
          // install the ListSelectionListener that listens on row selection changes
          if (e.getValueIsAdjusting())
            return;

          myModel.getActualTableModel().setSelectedCells(getActiveTable().getSelectedRows());

          if (getActiveTable().getSelectedRowCount() > 0) {
            if (getActiveTable().getSelectedColumnCount() == 1)
              myModel.getActualTableModel().setSelectedColumn(getActiveTable().getSelectedColumn());
          }
          else
            myModel.getActualTableModel().setSelectedColumn(-1);
        }
        catch (IllegalUserInputException e2)
        {/*cannot happen */}
      }
    });

    table.getColumnModel().getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        try {
          // install the ListSelectionListener that listens on column selection changes
          if (e.getValueIsAdjusting())
            return;
View Full Code Here

    final SelectionListener homeSelectionListener = new SelectionListener() {
        public void selectionChanged(SelectionEvent ev) {
          updateTableSelectedFurniture(home.getSelectedItems());       
        }
      };
    this.tableSelectionListener = new ListSelectionListener () {
        public void valueChanged(ListSelectionEvent ev) {
          selectionByUser = true;
          int [] selectedRows = getSelectedRows();
          // Build the list of selected furniture
          List<HomePieceOfFurniture> selectedFurniture =
View Full Code Here

            this.freedb = new JList(freedbModel);
            this.freedb.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            this.freedb.setCellRenderer(new FreedbRenderer());
            freeDbPane = new JScrollPane(freedb);
            freedb.getSelectionModel().addListSelectionListener(
                    new ListSelectionListener() {
                        public void valueChanged(ListSelectionEvent e) {
                            getAudioList().repaint();
                        }
                    });
        }
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.