Package javax.swing

Examples of javax.swing.DefaultListModel.addElement()


        };

        DefaultListModel model = new DefaultListModel();
        for (T element : elements) {
            Entry<T> entry = new Entry<T>(element);
            model.addElement(entry);
        }
        setModel(model);

        addMouseListener(mouseAdapter);
View Full Code Here


                    return comparator.compare(o1.presentable, o2.presentable);
                }
            });
        DefaultListModel newModel = new DefaultListModel();
        for (Entry<T> entry : entries) {
            newModel.addElement(entry);
        }
        setModel(newModel);
    }

    public boolean applyChanges(){
View Full Code Here

        ConnectionManager connectionManager = ConnectionManager.getInstance(project);
        for (ConnectionBundle connectionBundle : connectionManager.getConnectionBundles()) {
            for (ConnectionHandler connectionHandler : connectionBundle.getConnectionHandlers()) {
                if (connectionHandler.hasUncommittedChanges()) {
                    connectionHandlers.add(connectionHandler);
                    model.addElement(connectionHandler);
                }
            }
        }

        connectionsList.setModel(model);
View Full Code Here

        List<DBSchema> schemas = connectionHandler.getObjectBundle().getSchemas();
        DefaultListModel model = new DefaultListModel();

        for (DBSchema schema : schemas) {
            model.addElement(schema);
        }
        schemasList.setModel(model);
        schemasList.setSelectedValue(currentSchema, true);
    }
View Full Code Here

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

                    }
                    //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;
View Full Code Here

                                public void run () {
                                        cardLayout.show(getContentPane(), "chat");
                                        DefaultListModel model = (DefaultListModel)nameList.getModel();
                                        model.removeAllElements();
                                        for (String name : names)
                                                model.addElement(name);
                                }
                        });
                }

                public void addMessage (final String message) {
View Full Code Here

                public void addMessage (final String message) {
                        EventQueue.invokeLater(new Runnable() {
                                public void run () {
                                        DefaultListModel model = (DefaultListModel)messageList.getModel();
                                        model.addElement(message);
                                        messageList.ensureIndexIsVisible(model.size() - 1);
                                }
                        });
                }
        }
View Full Code Here

        signalViolation(Messages.getString("specifyClassPath"));
        return;
      }
      DefaultListModel model = (DefaultListModel) _classpathList.getModel();
      if (_classpathList.isSelectionEmpty()) {
        model.addElement(cp);
        clear();
      } else {
        model.setElementAt(cp, _classpathList.getSelectedIndex());
      }
    }
View Full Code Here

          _mainclassField.setText(mainClass != null ? mainClass : "");
          DefaultListModel model = new DefaultListModel();
          if (classPath != null) {
            String[] paths = classPath.split(" ");
            for (int i = 0; i < paths.length; i++) {
              model.addElement(paths[i]);
            }
          }
          _classpathList.setModel(model);
        }
      } catch (IOException ex) {
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.