Package javax.swing

Examples of javax.swing.MutableComboBoxModel.addElement()


  {
    MutableComboBoxModel newModel = new DefaultComboBoxModel();
    for (int i = 0, limit = s_sharedDataModel.getSize(); i < limit; ++i)
    {
      SQLHistoryItem obj = (SQLHistoryItem)s_sharedDataModel.getElementAt(i);
      newModel.addElement(obj.clone());
    }
    return newModel;
  }

   public ArrayList<SQLHistoryItem> getItems()
View Full Code Here


                else if(host_box_tf.hasFocus() )
                {
                    MutableComboBoxModel model = (MutableComboBoxModel)
                        m_host_box.getModel();

                    model.addElement( text );
                    model.setSelectedItem( text );
                }
            }
        }
        catch( Exception e)
View Full Code Here

    private ComboBoxModel createFontModel() {
        MutableComboBoxModel model = new DefaultComboBoxModel();
        // <snip> JXTitledPanel configure title properties
        // Font options (based on default)
        Font baseFont = UIManager.getFont("JXTitledPanel.titleFont");
        model.addElement(new DisplayInfo<Font>("Default ", baseFont));
        Font italicFont = new FontUIResource(baseFont.deriveFont(Font.ITALIC));
        model.addElement(new DisplayInfo<Font>("Derived (Italic)" , italicFont));
        Font bigFont = new FontUIResource(baseFont.deriveFont(baseFont.getSize2D() * 2));
        model.addElement(new DisplayInfo<Font>("Derived (Doubled Size) ", bigFont));
        // </snip>
View Full Code Here

        // <snip> JXTitledPanel configure title properties
        // Font options (based on default)
        Font baseFont = UIManager.getFont("JXTitledPanel.titleFont");
        model.addElement(new DisplayInfo<Font>("Default ", baseFont));
        Font italicFont = new FontUIResource(baseFont.deriveFont(Font.ITALIC));
        model.addElement(new DisplayInfo<Font>("Derived (Italic)" , italicFont));
        Font bigFont = new FontUIResource(baseFont.deriveFont(baseFont.getSize2D() * 2));
        model.addElement(new DisplayInfo<Font>("Derived (Doubled Size) ", bigFont));
        // </snip>
        return model;
    }
View Full Code Here

        Font baseFont = UIManager.getFont("JXTitledPanel.titleFont");
        model.addElement(new DisplayInfo<Font>("Default ", baseFont));
        Font italicFont = new FontUIResource(baseFont.deriveFont(Font.ITALIC));
        model.addElement(new DisplayInfo<Font>("Derived (Italic)" , italicFont));
        Font bigFont = new FontUIResource(baseFont.deriveFont(baseFont.getSize2D() * 2));
        model.addElement(new DisplayInfo<Font>("Derived (Doubled Size) ", bigFont));
        // </snip>
        return model;
    }
   
    private ComboBoxModel createBackgroundModel() {
View Full Code Here

    private ComboBoxModel createBackgroundModel() {
        MutableComboBoxModel model = new DefaultComboBoxModel();
        // <snip> JXTitledPanel configure title properties
        // Background Painter options
        Painter<?> baseFont =  (Painter<?>) UIManager.get("JXTitledPanel.titlePainter");
        model.addElement(new DisplayInfo<Painter<?>>("Default ", baseFont));
        model.addElement(new DisplayInfo<Painter<?>>("Checkerboard",
                new PainterUIResource<JComponent>(new CheckerboardPainter())));
        // PENDING JW: add more options - image, gradient, animated...
        // </snip>
        return model;
View Full Code Here

        MutableComboBoxModel model = new DefaultComboBoxModel();
        // <snip> JXTitledPanel configure title properties
        // Background Painter options
        Painter<?> baseFont =  (Painter<?>) UIManager.get("JXTitledPanel.titlePainter");
        model.addElement(new DisplayInfo<Painter<?>>("Default ", baseFont));
        model.addElement(new DisplayInfo<Painter<?>>("Checkerboard",
                new PainterUIResource<JComponent>(new CheckerboardPainter())));
        // PENDING JW: add more options - image, gradient, animated...
        // </snip>
        return model;
    }
View Full Code Here

    public void addElement(Object anObject)
    {
        checkMutableComboBoxModel();
        MutableComboBoxModel model = (MutableComboBoxModel)getComboBoxModel();
        model.addElement(anObject);
    }

    public void insertElementAt(int index,Object anObject)
    {
        checkMutableComboBoxModel();
View Full Code Here

    public void addElement(Object anObject)
    {
        checkMutableComboBoxModel();
        MutableComboBoxModel model = (MutableComboBoxModel)getComboBoxModel();
        model.addElement(anObject);
    }

    public void insertElementAt(int index,Object anObject)
    {
        checkMutableComboBoxModel();
View Full Code Here

            }
        }

        if (insert < 0) {
            insert = model.getSize();
            model.addElement(Integer.valueOf(newValue));
        } else {
            model.insertElementAt(Integer.valueOf(newValue), insert);
        }
        pointSizeCBox.setSelectedIndex(insert);
    }
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.