Package javax.swing

Examples of javax.swing.JList


  private JPanel createEnumerationEditor()
  {
    enumEntryEditField = new JTextField();
    enumEntryListModel = new DefaultListModel();

    enumEntryList = new JList(enumEntryListModel);
    enumEntryList.addListSelectionListener(new EnumerationListSelectionHandler());

    final JPanel listPanel = new JPanel();
    listPanel.setLayout(new BorderLayout());
    listPanel.add(enumEntryEditField, BorderLayout.NORTH);
View Full Code Here


     *
     * @param e not used.
     */
    public void actionPerformed(final ActionEvent e)
    {
      final JList enumEntryList = getEnumEntryList();
      final DefaultListModel enumEntryListModel = getEnumEntryListModel();
      final int[] selectedEntries = enumEntryList.getSelectedIndices();
      for (int i = selectedEntries.length - 1; i >= 0; i--)
      {
        enumEntryListModel.remove(selectedEntries[i]);
      }
      enumEntryList.clearSelection();
    }
View Full Code Here

            icbp = new ImageControlButtonPanel();
            gridbag.setConstraints(icbp, c);

            itPanel.add(icbp);

            resultsList = new JList(getListModel());
            resultsList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
            listManager = new ListManager();
            resultsList.addListSelectionListener(listManager);
            resultsList.addMouseListener(listManager);
            resultsList.addMouseMotionListener(listManager);
View Full Code Here

        contentPane.add(panel, "chat");
        {
          JPanel topPanel = new JPanel(new GridLayout(1, 2));
          panel.add(topPanel);
          {
            topPanel.add(new JScrollPane(messageList = new JList()));
            messageList.setModel(new DefaultListModel());
          }
          {
            topPanel.add(new JScrollPane(nameList = new JList()));
            nameList.setModel(new DefaultListModel());
          }
          DefaultListSelectionModel disableSelections = new DefaultListSelectionModel() {
            public void setSelectionInterval (int index0, int index1) {
            }
View Full Code Here

        contentPane.add(panel, "chat");
        {
          JPanel topPanel = new JPanel(new GridLayout(1, 2));
          panel.add(topPanel);
          {
            topPanel.add(new JScrollPane(messageList = new JList()));
            messageList.setModel(new DefaultListModel());
          }
          {
            topPanel.add(new JScrollPane(nameList = new JList()));
            nameList.setModel(new DefaultListModel());
          }
          DefaultListSelectionModel disableSelections = new DefaultListSelectionModel() {
            public void setSelectionInterval (int index0, int index1) {
            }
View Full Code Here

        templatesPanels.setLayout(new CardLayout());

        inner.add(templatesPanels, BorderLayout.CENTER);
       
      
        tlist = new JList(new TemplateListModel());
        tlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tlist.setVisibleRowCount(5);
        JScrollPane tlistScrollPane = new JScrollPane(tlist);
        content.add(tlistScrollPane, BorderLayout.WEST);
View Full Code Here

        }
        // If there are conflicts, solve them...
        if (!clm.resolved()) {
            if (JSynoptic.gui != null) {
                conflictsOK = false;
                final JList list = new JList(clm);
                list.setCellRenderer(new ConflictListCellRenderer());
                JButton changeSourceAlias;
                JPanel treePane = new JPanel(new BorderLayout());
                final SourceTree st = SourceTree.getFromPool("PropertiesPanel0");
                treePane.add(new JScrollPane(st), BorderLayout.CENTER);
                JPanel bpanel = new JPanel(new GridLayout(1, 1));
                bpanel.add(changeSourceAlias = new JButton(resources.getString("changeSourceAlias")));
                treePane.add(bpanel, BorderLayout.SOUTH);
                JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(list), treePane);
                list.setVisibleRowCount(10);
                JPanel bbox = new JPanel(new FlowLayout());
                final JButton bok;
                bbox.add(bok = new JButton("OK"));
                // bbox.add(bcancel = new JButton("Cancel"));
                final JDialog dialog = new JDialog(JSynoptic.gui.getOwner(), resources
                        .getString("conflictResolutionDialog"), true);
                dialog.getContentPane().add(pane, BorderLayout.CENTER);
                dialog.getContentPane().add(bbox, BorderLayout.SOUTH);
                bok.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        conflictsOK = true;
                        dialog.setVisible(false);
                    }
                });
                /*
                 * bcancel.addActionListener(new ActionListener() { public void
                 * actionPerformed(ActionEvent e) { conflictsOK = false;
                 * dialog.hide(); } });
                 */
                changeSourceAlias.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        Object o = st.getSelectedSourceOrCollection();
                        if (!(o instanceof DataSource)) {
                            return;
                        }
                        VariableConflict vc = (VariableConflict) list.getSelectedValue();
                        ((DataSource) o).getInformation().alias = vc.var;
                        list.repaint();
                        if (clm.resolved()) {
                            bok.setEnabled(true);
                        }
                        TreeNode tn = (TreeNode) (st.getSelectionPath().getLastPathComponent());
                        ((DefaultTreeModel) (st.getModel())).nodeChanged(tn);
                    }
                });
                st.addTreeSelectionListener(new TreeSelectionListener() {
                    public void valueChanged(TreeSelectionEvent e) {
                        Object o = st.getSelectedSourceOrCollection();
                        if ((o instanceof DataSource) && e.isAddedPath()) {
                            VariableConflict vc = (VariableConflict) list.getSelectedValue();
                            vc.ds = (DataSource) o;
                            list.repaint();
                            if (clm.resolved()) {
                                bok.setEnabled(true);
                            }
                            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;
                        }
                        st.setSelectedValue(((VariableConflict) sel).ds); // call
                        // the
                        // tree
                        // selection
                        // listener
                        // in
                        // turn
                    }
                });
                list.setSelectedIndex(0);
                bok.setEnabled(false);
                dialog.pack();
                dialog.setVisible(true);
                if (!conflictsOK) {
                    return null; // cancel => do not create the source
View Full Code Here

        };
        cmLabel = new JLabel(resources.getString("ChooseAnImageMapper"));
        cmLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
        final SvgMapperListModel listModel = new SvgMapperListModel();
        // Create the list and put it in a scroll pane.
        cmlist = new JList(listModel);
        cmlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        cmlist.setVisibleRowCount(5);
        JScrollPane cmlistScrollPane = new JScrollPane(cmlist);
        cmNew = new JButton(resources.getString("New"));
        cmDelete = new JButton(resources.getString("Delete"));
View Full Code Here

                }
            }
        });

        // Create the list and put it in a scroll pane.
        cmlist = new JList();
        cmlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        cmlist.setVisibleRowCount(5);

        dstree = FilteredSourceTree.getFromPool("PropertiesPanel0");
        dstree.getSourceTree().addTreeSelectionListener(new TreeSelectionListener() {
View Full Code Here

  private void init() {
   
    split_pane = new JSplitPane();
    shared_folders_scroll_pane = new JScrollPane();
    shared_files_scroll_pane = new JScrollPane();
    shared_folders_list = new JList();
    shared_folders_list_model = new SharedFoldersListModel();
    top_panel = new TopPanel();
   
   
    shared_folders_list.setModel(shared_folders_list_model);
View Full Code Here

TOP

Related Classes of javax.swing.JList

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.