Package javax.swing

Examples of javax.swing.DefaultListModel


        // Initialize the GUI components
        initComponents();

        // Add a list model for the list of capabilities. Also, listen for
        // selections on the list to display the appropriate panel
        listModel = new DefaultListModel();
        capabilityList.setModel(listModel);
        capabilityList.addListSelectionListener(new CapabilityListSelectionListener());

        // Create and add a basic panel for all cells as a special case.
        basicPropertiesFactory = new BasicJPanel();
View Full Code Here


     */
    public void setFactorySet(Set<CellFactorySPI> factorySet) {
        // Simply create a new model and populate with the elements in the set.
        // We add the CellFactorySPI directly into the list and use the list
        // renderer to display the Cell display names in the list.
        DefaultListModel model = new DefaultListModel();
        for (CellFactorySPI factory : factorySet) {
            model.addElement(factory);
        }
        cellList.setModel(model);
        cellList.setSelectedIndex(0);
    }
View Full Code Here

        initComponents();
       
        this.cell = cell;
        this.editor = editor;
       
        model = new DefaultListModel();
        editorDialog = new JDialog();
        editorDialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
//        editorPanel = new SkyboxEditor();
       
        originalActiveName = cell.getActiveSkyboxName();
View Full Code Here

    public HUDCellPalette() {
        initComponents();

        imageList = new ArrayList();
        model = new DefaultListModel();
        componentList.setModel(model);
        componentList.setCellRenderer(new ListImageRenderer());
        componentList.setDragEnabled(true);

        // Create a generic image for cells that don't have a preview image
View Full Code Here

        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jdesktop/wonderland/modules/artimport/client/jme/resources/Bundle"); // NOI18N
        jLabel1.setText(bundle.getString("Models")); // NOI18N
        jPanel1.add(jLabel1, java.awt.BorderLayout.NORTH);

        modelList.setModel(new DefaultListModel());
        modelList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        modelList.setFixedCellWidth(120);
        modelList.setMaximumSize(new java.awt.Dimension(60, 85));
        modelList.setMinimumSize(new java.awt.Dimension(60, 85));
        modelList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
View Full Code Here

        for (int i = 0; i < c; i++)
        {
            _playlist.addElement(playlist.getItemAt(i));
        }
        restrictedPlaylist = _playlist;
        m = new DefaultListModel();
        for (int i = 0; i < _playlist.size(); i++)
        {
            PlaylistItem plItem = (PlaylistItem) _playlist.get(i);
            if (plItem.isFile()) m.addElement(getDisplayString(plItem));
        }
View Full Code Here

            list.setModel(m);
            restrictedPlaylist = _playlist;
        }
        else
        {
            DefaultListModel newModel = new DefaultListModel();
            if (lastSearch != null)
            {
                if (searchString.length() <= 1 || !searchString.substring(searchString.length() - 2).equals(lastSearch))
                {
                    list.setModel(m);
                    restrictedPlaylist = _playlist;
                }
            }
            Vector pI = restrictedPlaylist;
            restrictedPlaylist = new Vector();
            for (int a = 0; a < s.length; a++)
            {
                String currentS = s[a];
                int size = list.getModel().getSize();
                boolean[] remove = new boolean[size];
                for (int i = 0; i < size; i++)
                {
                    final int TITLE_SEARCH = 0;
                    final int ARTIST_SEARCH = 1;
                    final int ALBUM_SEARCH = 2;
                    final int FILENAME_SEARCH = 3;
                    TagInfo pli = ((PlaylistItem) pI.get(i)).getTagInfo();
                    remove[i] = false;
                    boolean found = false;
                    int searchType;
                    if (artist.isSelected())
                    {
                        searchType = ARTIST_SEARCH;
                    }
                    else if (album.isSelected())
                    {
                        searchType = ALBUM_SEARCH;
                    }
                    else if (title.isSelected())
                    {
                        searchType = TITLE_SEARCH;
                    }
                    else
                    {
                        searchType = -1;
                    }
                    for (int j = 0; j <= FILENAME_SEARCH; j++)
                    {
                        String listString = "";
                        if (pli == null)
                        {
                            if (searchType != -1)
                            {
                                break;
                            }
                            j = FILENAME_SEARCH;
                        }
                        else if (searchType != -1)
                        {
                            j = searchType;
                        }
                        switch (j)
                        {
                            case (TITLE_SEARCH):
                                if (pli.getTitle() != null) listString = pli.getTitle().toLowerCase();
                                break;
                            case (ARTIST_SEARCH):
                                if (pli.getArtist() != null) listString = pli.getArtist().toLowerCase();
                                break;
                            case (ALBUM_SEARCH):
                                if (pli.getAlbum() != null) listString = pli.getAlbum().toLowerCase();
                                break;
                            case (FILENAME_SEARCH):
                                String location = ((PlaylistItem) pI.get(i)).getLocation().toLowerCase();
                                listString = location.substring(location.lastIndexOf(sep) + 1, location.lastIndexOf("."));
                                break;
                        }
                        currentS = currentS.toLowerCase();
                        if (found = search(currentS, listString))
                        {
                            break;
                        }
                        if (searchType != -1)
                        {
                            break;
                        }
                    }
                    //if(found)foundAt[a] = i;
                    if (found && a == 0)
                    {
                        //todo new
                        newModel.addElement(getDisplayString((PlaylistItem) pI.get(i)));
                        restrictedPlaylist.add(pI.get(i));
                    }
                    if (!found && a != 0)
                    {
                        remove[i] = true;
                    }
                }
                //remove all unmatching items
                for (int x = size - 1; x >= 0; x--)
                {
                    if (remove[x])
                    {
                        newModel.remove(x);
                        restrictedPlaylist.remove(x);
                    }
                }
                pI = restrictedPlaylist;
                list.setModel(newModel);
View Full Code Here

  this.caller = caller;
  this.group = group;

        initComponents();

  userListModel = new DefaultListModel();
        addUserList.setModel(userListModel);
  addUserList.setCellRenderer(new UserListCellRenderer());
 
        pm = PresenceManagerFactory.getPresenceManager(session);
View Full Code Here

                                {
                                        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

                        // This listener is run on the client's update thread, which was started by client.start().
                        // We must be careful to only interact with Swing components on the Swing event thread.
                        EventQueue.invokeLater(new Runnable() {
                                public void run () {
                                        cardLayout.show(getContentPane(), "chat");
                                        DefaultListModel model = (DefaultListModel)nameList.getModel();
                                        model.removeAllElements();
                                        for (String name : names)
                                                model.addElement(name);
                                }
                        });
                }
View Full Code Here

TOP

Related Classes of javax.swing.DefaultListModel

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.