Package javax.swing

Examples of javax.swing.JList$ListSelectionEventPropagator


        "pref, 3dlu, pref, 3dlu, pref, 3dlu, fill:pref:grow"));

    CellConstraints cc = new CellConstraints();

    DefaultListModel listModel = new DefaultListModel();
    mExclusionsList = new JList(listModel);
    for (Exclusion exclusion : exclusions) {
      listModel.addElement(exclusion);
    }
    mExclusionsList.setCellRenderer(new ExclusionListCellRenderer());
   
View Full Code Here


      }
    });
    rightPanel.add(buttClose,1);

    // list
    urlList = new JList();
    urlList.setVisibleRowCount(6);
    urlList.setMinimumSize(new java.awt.Dimension(40,4));
    urlList.setListData(urls);
    JScrollPane urlScroll = new JScrollPane();
    urlScroll.setViewportView(urlList);
View Full Code Here

    ListSelectorDialog    dialog;
    ArffSortedTableModel       model;
    Object[]              atts;
    int[]                 indices;
    int                   i;
    JList                 list;
    int                   result;
   
    list   = new JList(getAttributes());
    dialog = new ListSelectorDialog(null, list);
    result = dialog.showDialog();
   
    if (result != ListSelectorDialog.APPROVE_OPTION)
      return;
   
    atts = list.getSelectedValues();
   
    // really?
    if (ComponentHelper.showMessageBox(
        getParent(),
        "Confirm...",
View Full Code Here

  public ChannelChooserPanel(MainFrame frame) {
    mParent = frame;

    mChannelChooserModel = new DefaultListModel();

    mList = new JList(mChannelChooserModel);
    updateChannelChooser();
    setLayout(new BorderLayout());
    add(new JScrollPane(mList));

    ListDragAndDropHandler dnDHandler = new ListDragAndDropHandler(mList,
View Full Code Here

      mCloseBtn.setEnabled(mSoftwareUpdateItemList.getSelection().length == 0);
    }

    if(event.getSource() instanceof JList) {
      if(!event.getValueIsAdjusting()) {
        JList list = ((JList)event.getSource());

        if(mLastIndex != -1 && list.getSelectedIndex() != mLastIndex && list.getModel().getSize()-1 >= mLastIndex) {
          ((MyListUI)list.getUI()).setCellHeight(mLastIndex,list.getCellRenderer().getListCellRendererComponent(list, list.getModel().getElementAt(mLastIndex),
              mLastIndex, false, false).getPreferredSize().height);
        }

        mLastIndex = list.getSelectedIndex();
        if (mLastIndex < 0) {
          mHelpBtn.setEnabled(false);
        }
        else {
          SoftwareUpdateItem item = (SoftwareUpdateItem) ((SelectableItem)mSoftwareUpdateItemList.getSelectedValue()).getItem();
View Full Code Here

    }
  }

  private void showPopupMenu(MouseEvent e) {
    if(e.getSource() instanceof JList) {
      JList list = (JList)e.getSource();

      Object listItem = list.getModel().getElementAt(list.locationToIndex(e.getPoint()));

      if(listItem instanceof SelectableItem) {
        final Object item = ((SelectableItem)listItem).getItem();

        if(item instanceof SoftwareUpdateItem) {
View Full Code Here

            public int compare(Channel o1, Channel o2) {
                return o1.getName().compareToIgnoreCase(o2.getName());
            }
        });
       
        JList list = new JList(ch);
        list.setCellRenderer(new ChannelListCellRenderer(true, true));
       
        channelPanel.add(new JScrollPane(list), BorderLayout.CENTER);
       
        JPanel btnPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
       
View Full Code Here

    JPanel panel2 = new JPanel(new BorderLayout(10, 0));

    mGroupListModel = new DefaultListModel();

    mGroupList = new JList(mGroupListModel);
    mGroupList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    panel2.add(new JScrollPane(mGroupList), BorderLayout.CENTER);

    JPanel panel3 = new JPanel(new BorderLayout());
    JPanel btnPn = new JPanel();
View Full Code Here

    JPanel leftPanel=new JPanel(new BorderLayout());
    JPanel rightPanel=new JPanel(new BorderLayout());

    mLeftListModel = new DefaultListModel();
    mLeftList = new JList(mLeftListModel);
    mLeftList.setVisibleRowCount(10);
    mLeftList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    mLeftList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent evt) {
        updateEnabled();
      }
    });

    mRightListModel = new DefaultListModel();
    mRightList = new JList(mRightListModel);
    mRightList.setVisibleRowCount(10);
    mRightList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    mRightList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent evt) {
        updateEnabled();
View Full Code Here

    // If theTransferable is a TransferEntries drop it
    if(flavors != null && flavors.length == 2 &&
        flavors[0].getHumanPresentableName().equals("Indices") &&
        flavors[1].getHumanPresentableName().equals("Source")) {
      try {
        JList target = (JList)((DropTarget)e.getSource()).getComponent();
        int x = target.locationToIndex(e.getLocation());
       
        Rectangle rect = target.getCellBounds(x,x);
        if(rect != null) {
          rect.setSize(rect.width,rect.height/2);
       
          if(!rect.contains(e.getLocation())) {
            x++;
          }
        } else {
          x = 0;
        }
               
        if(target.equals(mTarget)) {
          mAction.drop(mSource,mTarget,x,false);
        }
        else if(target.equals(mSource)) {
          mAction.drop(mSource,mSource,x,false);
        }
       
      }catch(Exception ee) {ee.printStackTrace();}
    }
View Full Code Here

TOP

Related Classes of javax.swing.JList$ListSelectionEventPropagator

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.