Package javax.swing

Examples of javax.swing.DefaultListCellRenderer$UIResource


        resultStyle = new SimpleAttributeSet();
        StyleConstants.setItalic(resultStyle, true);
        StyleConstants.setForeground(resultStyle, new Color(0x20, 0x4a, 0x87));
       
        completeCombo = new JComboBox();
        completeCombo.setRenderer(new DefaultListCellRenderer()); // no silly ticks!
        completePopup = new BasicComboPopup(completeCombo);
       
        if (message != null) {
            final MutableAttributeSet messageStyle = new SimpleAttributeSet();
            StyleConstants.setBackground(messageStyle, area.getForeground());
View Full Code Here


        ListModel model = new InteractionSwingListModel(listProxy);

        list.setModel(model);
        list.setCellRenderer(
                new DefaultListCellRenderer() {
                    public Component getListCellRendererComponent(
                            JList list, Object value, int index,
                            boolean isSelected,
                            boolean cellHasFocus) {
View Full Code Here

    this.ac = ac;
    model = new CompletionListModel();
    list = new JList(model);
//    list.setCellRenderer(new DelegatingCellRenderer());
    list.setCellRenderer(new DefaultListCellRenderer());
    list.addListSelectionListener(this);
    list.addMouseListener(this);
    list.setFixedCellHeight(20);
   
    JPanel contentPane = new JPanel(new BorderLayout());
View Full Code Here

        implements ListCellRenderer {
        DefaultListCellRenderer defaultComp;
        JCheckBox checkbox;
        public CheckBoxListCellRenderer() {
            setLayout (new BorderLayout());
            defaultComp = new DefaultListCellRenderer();
            checkbox = new JCheckBox();
            add (checkbox, BorderLayout.WEST);
            add (defaultComp, BorderLayout.CENTER);
        }
View Full Code Here

                    // double click is same as cliking the OK button.
                  XRegistryLoaderWindow.this.okButton.doClick();
                }
            }
        });
        DefaultListCellRenderer renderer = new DefaultListCellRenderer() {
            /**
             * @see javax.swing.DefaultListCellRenderer#getListCellRendererComponent(javax.swing.JList,
             *      java.lang.Object, int, boolean, boolean)
             */
            @Override
            public Component getListCellRendererComponent(JList jList,
                                                          Object value, int index, boolean isSelected,
                                                          boolean cellHasFocus) {
                DefaultListCellRenderer listCellRendererComponent = (DefaultListCellRenderer) super
                        .getListCellRendererComponent(jList, value, index,
                                isSelected, cellHasFocus);
                if (value instanceof XRSearchResult) {
                  QName qname = ((XRSearchResult) value).getQname();
                    listCellRendererComponent.setText(qname.getNamespaceURI()+": "+qname.getLocalPart());
                }
                return listCellRendererComponent;
            }

        };
View Full Code Here

            i++;
        }
       
        JList<Class<?>> list = new JList<Class<?>>(classListObj);
       
        ListCellRenderer<Object> localeRenderer = new DefaultListCellRenderer() {
            private static final long serialVersionUID = 1L;
           
            @Override
            public JComponent getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {     
                super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
View Full Code Here

        if (Class.class.isAssignableFrom(selected.getClass())) {
            Class<?> c = (Class<?>) selected;
           
            JList<Constructor<?>> list = new JList<>(c.getConstructors());
           
            ListCellRenderer<Object> localeRenderer = new DefaultListCellRenderer() {
                private static final long serialVersionUID = 1L;
               
                @Override
                public JComponent getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {     
                    super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
View Full Code Here

        simpleReceiverModel.addElement(SocketReceiver.class);
        simpleReceiverModel.addElement(SocketHubReceiver.class);

        final JComboBox receiverCombo = new JComboBox(simpleReceiverModel);
        receiverCombo.setEditable(false);
        receiverCombo.setRenderer(new DefaultListCellRenderer() {
                public Component getListCellRendererComponent(JList list,
                    Object value, int index, boolean isSelected,
                    boolean cellHasFocus) {

                    Component c = super.getListCellRendererComponent(list,
View Full Code Here

    CellConstraints cc = new CellConstraints();

    panel.add(new JLabel(mLocalizer.msg("chooseLanguage","Please choose language:")), cc.xyw(1,1,3));

    mLangBox = new JComboBox(newLocales);
    mLangBox.setRenderer(new DefaultListCellRenderer() {
      @Override
      public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        return super.getListCellRendererComponent(list, ((Locale)value).getDisplayName(), index, isSelected, cellHasFocus);
      }
    });
View Full Code Here

        UiUtilities.registerForClosing(this);

        DriverIf[] drivers = DriverFactory.getInstance().getDrivers();

        mDriverCombo = new JComboBox(drivers);
        mDriverCombo.setRenderer(new DefaultListCellRenderer() {
          public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {

            if (value instanceof DriverIf) {
              value = ((DriverIf)value).getDriverName();
            }
View Full Code Here

TOP

Related Classes of javax.swing.DefaultListCellRenderer$UIResource

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.