Package javax.swing.plaf.basic

Examples of javax.swing.plaf.basic.BasicComboBoxRenderer


    JPanel typePanel = new JPanel();
    typePanel.setLayout(new BoxLayout(typePanel, BoxLayout.X_AXIS));

    final JComboBox typeBox = new JComboBox(types.toArray());
    typeBox.setRenderer(new BasicComboBoxRenderer() {
      private static final long serialVersionUID = 1L;
      @Override
      public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        Component result = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        ((JLabel) result).setText(((Class<?>) value).getSimpleName());
View Full Code Here


  private JPanel myPanel = new JPanel(new GridBagLayout());
  private JComboBox myComboBox = new JComboBox();

  private ComboBoxTableCellEditor() {
    myComboBox.setRenderer(new BasicComboBoxRenderer());
    myPanel.add(
      myComboBox,
        new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)
    );
  }
View Full Code Here

    fileComboBox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        sourceFileSelectionChanged();
      }
    });
    fileComboBox.setRenderer(new BasicComboBoxRenderer() {
      private static final long serialVersionUID = -2135703608960229528L;
      public Component getListCellRendererComponent(JList list, Object value,
          int index, boolean isSelected, boolean cellHasFocus) {
        if (isSelected) {
          setBackground(list.getSelectionBackground());
View Full Code Here

TOP

Related Classes of javax.swing.plaf.basic.BasicComboBoxRenderer

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.