Examples of ListSelectionListener


Examples of javax.swing.event.ListSelectionListener

            }
        });
        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

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

Examples of javax.swing.event.ListSelectionListener

     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

Examples of javax.swing.event.ListSelectionListener

  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

Examples of javax.swing.event.ListSelectionListener

         }
      });
      _popUp.add(mnuAppendSelectionToEditor);


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

Examples of javax.swing.event.ListSelectionListener

        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

Examples of javax.swing.event.ListSelectionListener

   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

Examples of javax.swing.event.ListSelectionListener

    }


    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

Examples of javax.swing.event.ListSelectionListener

    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

Examples of javax.swing.event.ListSelectionListener

    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
TOP
Copyright © 2018 www.massapi.com. 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.