Package javax.swing

Examples of javax.swing.DefaultListCellRenderer$UIResource


    public PartitionPanel() {
        initComponents();
        setMinimumSize(new Dimension(50, 90));

        //List renderer
        final ListCellRenderer renderer = new DefaultListCellRenderer() {

            @Override
            public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {

                final JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
View Full Code Here


        standardAspectLabel = new JLabel("Standard Aspect:");
        standardAspectLabel.setDisplayedMnemonic('s');

        standardAspectComboBox = new JComboBox(ASPECTS);
        standardAspectComboBox.setEditable(false);
        standardAspectComboBox.setRenderer(new DefaultListCellRenderer() {
            @Override
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                JLabel l = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
                String[] val = (String[])value;
                l.setText(val[0]);
View Full Code Here

        standardCropLabel = new JLabel("Standard Crop:");
        standardCropLabel.setDisplayedMnemonic('s');

        standardCropComboBox = new JComboBox(CROP_GEOMETRIES);
        standardCropComboBox.setEditable(false);
        standardCropComboBox.setRenderer(new DefaultListCellRenderer() {
            @Override
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                JLabel l = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
                String[] val = (String[])value;
                l.setText(val[0]);
View Full Code Here

        DefaultComboBoxModel presetModel = (DefaultComboBoxModel)presetComboBox.getModel();
        presetModel.addElement(null);
        for(String presetName : presets) {
            presetModel.addElement(presetName);
        }
        presetComboBox.setRenderer(new DefaultListCellRenderer() {
            @Override
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                JLabel label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
                if(value != null) {
                    label.setText(String.valueOf(value));
View Full Code Here

  private void initialGUI(Container content,
      final DefaultModalGraphMouse<Integer, Number> graphMouse) {
    Vector<Class<? extends Layout<Vertex, Edge>>> combos = getCombos();
    final JComboBox jcb = new JComboBox(combos);
    // use a renderer to shorten the layout name presentation
    jcb.setRenderer(new DefaultListCellRenderer() {
      private static final long serialVersionUID = 2886015296102490146L;

      public Component getListCellRendererComponent(JList list,
          Object value, int index, boolean isSelected,
          boolean cellHasFocus) {
View Full Code Here

        private Dimension getPrototypeSize(Object prototypeValue) {
            // get the renderer responsible for drawing the prototype value
            ListCellRenderer renderer = comboBox.getRenderer();
            if (renderer == null)
                renderer = new DefaultListCellRenderer();

            // get the component from the renderer
            final Component comp = renderer.getListCellRendererComponent(popup.getList(), prototypeValue, -1, false, false);

            // determine the preferred size of the component
View Full Code Here

            volumeSlider.getMaximum());

 
        // set renderer for placemarks
        placemarkCB.setModel(new DefaultComboBoxModel());
        placemarkCB.setRenderer(new DefaultListCellRenderer() {
            private JSeparator separator = new JSeparator(JSeparator.HORIZONTAL);
           
            @Override
            public Component getListCellRendererComponent(JList list,
                    Object value, int index, boolean isSelected,
View Full Code Here

                                                    new StochasticUniversalSampling(),
                                                    new TournamentSelection(new Probability(0.95)),
                                                    new TruncationSelection(0.5)};
     
      selectionCombo = new JComboBox(selectionStrategies);
      selectionCombo.setRenderer(new DefaultListCellRenderer() {
        @Override
        public Component getListCellRendererComponent(JList list,
                                                      Object value,
                                                      int index,
                                                      boolean isSelected,
View Full Code Here

  public FormulaFragmentCellRenderer()
  {
    tableCellRenderer = new DefaultTableCellRenderer();
    tableCellRenderer.putClientProperty("html.disable", Boolean.TRUE); // NON-NLS

    listCellRenderer = new DefaultListCellRenderer();
    listCellRenderer.putClientProperty("html.disable", Boolean.TRUE); // NON-NLS
  }
View Full Code Here

  public FormulaFragmentCellRenderer()
  {
    tableCellRenderer = new DefaultTableCellRenderer();
    tableCellRenderer.putClientProperty("html.disable", Boolean.TRUE); // NON-NLS

    listCellRenderer = new DefaultListCellRenderer();
    listCellRenderer.putClientProperty("html.disable", Boolean.TRUE); // NON-NLS
  }
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.