Examples of JList


Examples of javax.swing.JList

    // 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

Examples of javax.swing.JList

  public SortableItemList(String title) {
    this(title, new Object[]{});
  }

  public SortableItemList(String title, Object[] objects) {
    this(title, objects, new JList());
  }
View Full Code Here

Examples of javax.swing.JList

    setLayout(new BorderLayout(0,3));
   
    mListModel = new SelectableItemListModel();
    setEntries(currSelection,allItems,notSelectableItems);
   
    mList = new JList(mListModel);
    mList.setCellRenderer(mItemRenderer = new SelectableItemRenderer());
   
    mScrollPane = new JScrollPane(mList);
   
    mScrollPane.getVerticalScrollBar().setBlockIncrement(50);
View Full Code Here

Examples of javax.swing.JList

        c = new GridBagConstraints();
        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(5, 5, 5, 5);
        resultPanel.add(addResultButton, c);
       
        resultList = new JList();
        resultList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        resultList.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                removeResultButton.setEnabled(resultList.getSelectedIndex() != -1);
            }
View Full Code Here

Examples of javax.swing.JList

        });
        c = new GridBagConstraints();
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(updateButton, c);
       
        workItemsList = new JList();
        workItemsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        workItemsList.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    select();
View Full Code Here

Examples of javax.swing.JList

        JPanel panel = new JPanel();
        panel.setLayout(new GridBagLayout());
        getRootPane().setLayout(new BorderLayout());
        getRootPane().add(panel, BorderLayout.CENTER);
       
        workItemsList = new JList();
        workItemsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        workItemsList.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    select();
View Full Code Here

Examples of javax.swing.JList

    this.listParameter = listParameter;
    this.updateContext = updateContext;
    this.parameterContext = parameterContext;
    this.selectionCache = new ArrayList<Integer>();

    list = new JList();
    list.setCellRenderer(new FixedTheJDKListCellRenderer());

    if (listParameter.isAllowMultiSelection())
    {
      list.addListSelectionListener(new MultiValueListParameterHandler(listParameter.getName()));
View Full Code Here

Examples of javax.swing.JList

  }

  protected Component createContentPane()
  {
    drillDownProfiles = new DefaultListModel();
    profileList = new JList(drillDownProfiles);
    profileList.setCellRenderer(new DrillDownProfileListRenderer());

    final JPanel buttonPane = new JPanel();
    buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 5));
    buttonPane.add(new JButton(new NewAction()));
View Full Code Here

Examples of javax.swing.JList

        return panel;
    }

    private Component createListPanel() {
        model = new DefaultListModel();
        list = new JList(model);

        list.setCellRenderer(new FilterRenderer());

        list.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
View Full Code Here

Examples of javax.swing.JList

    }
  }

  public List(Widget parent, String name) throws GUIException {
    super(parent, name);
    list = new JList();
    list.setCellRenderer(new ListCellRenderer());
    scrollPane = new JScrollPane(list);
    list.addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        try {
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.