NPE in combo boxes with font

View: New views
6 Messages — Rating Filter:   Alert me  

NPE in combo boxes with font

by T. Waligora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I have some problems with combo boxes in SubstanceRavenLookAndFeel. I
get NPE in SubstanceComboBoxUI (e.g. in the method "configureEditor" or
in "getMinimumSize") when I set a font while creating the combo box.
Though everything works fine when I don't set any font.

Since Substance 4.3RC the background of the editable combo box is white
and not in the color of our L&F (e.g. blue). With version 4.2 the
background is correct (in blue).

See the TestApp (ComboBoxTest.java) .

Editable combo box with font:
Exception in thread "main" java.lang.NullPointerException
    at
javax.swing.plaf.basic.BasicComboBoxUI.configureEditor(BasicComboBoxUI.java:738)
    at
org.jvnet.substance.SubstanceComboBoxUI.configureEditor(SubstanceComboBoxUI.java:705)
    at
javax.swing.plaf.basic.BasicComboBoxUI.addEditor(BasicComboBoxUI.java:695)
    at
javax.swing.plaf.basic.BasicComboBoxUI$Handler.propertyChange(BasicComboBoxUI.java:1604)
    at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:318)....

Non-editable combo box with font:
Exception in thread "main" java.lang.NullPointerException
    at
org.jvnet.substance.SubstanceComboBoxUI.getMinimumSize(SubstanceComboBoxUI.java:268)
    at
javax.swing.plaf.basic.BasicComboBoxUI.getPreferredSize(BasicComboBoxUI.java:865)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1632)
    at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:702)
    at java.awt.Container.preferredSize(Container.java:1616)
    at java.awt.Container.getPreferredSize(Container.java:1601)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)

Sometimes I get this Exception, but I don't know why:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at
org.jvnet.substance.SubstanceComboBoxUI$ComboBoxPropertyChangeHandler$2.run(SubstanceComboBoxUI.java:356)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)



package de.or.console.test;

import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Vector;

import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.WindowConstants;

import org.jvnet.substance.skin.SubstanceRavenLookAndFeel;

public class ComboBoxTest extends JFrame {

    public static void main(String[] args)
    {
        try
        {
            UIManager.setLookAndFeel(new SubstanceRavenLookAndFeel());
            new ComboBoxTest("Test");
        } catch (UnsupportedLookAndFeelException e)
        {
            System.out.println(e);
        }
    }

    public ComboBoxTest(String title)
    {
        super(title);
        initGUI();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        setLocationRelativeTo(null);
        addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e)
            {
                System.exit(0);
            }
        });
        pack();
        setVisible(true);
    }

    private void initGUI()
    {
        JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());
        Vector<String> boxVector = new Vector<String>();
        boxVector.add("Test 1");
        boxVector.add("Test 2");
        JComboBox comboBox = new JComboBox(boxVector);

        // I get NPE in SubstanceComboBoxUI when I set a font while creating the
        // combobox.
        // everything works fine when I don't set any font, here
        comboBox.setFont(new Font("Verdana", Font.PLAIN, 12));

        comboBox.setEditable(true);

        panel.add(comboBox, BorderLayout.CENTER);
        getContentPane().add(panel);
    }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

Parent Message unknown Re: NPE in combo boxes with font

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

Your UI is not constructed on EDT. Changing the main method to respect the EDT rules fixes the NPE:

    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(new SubstanceRavenLookAndFeel());
        } catch (UnsupportedLookAndFeelException e) {
            System.out.println(e);
        }
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                new ComboBoxTest("Test");
            }
        });
    }

Regarding your second question - would you mind clarifying the "our L&F" part? Is it a custom L&F based on Substance, a custom Substance skin or something else? I would need to see a small test application that shows different behavior under 4.2 and 4.3

Thanks
Kirill

----- Original Message ----
From: T. Waligora <tina.waligora@...>
To: users@...
Sent: Wednesday, April 23, 2008 12:32:49 AM
Subject: NPE in combo boxes with font

Hi,
I have some problems with combo boxes in SubstanceRavenLookAndFeel. I
get NPE in SubstanceComboBoxUI (e.g. in the method "configureEditor" or
in "getMinimumSize") when I set a font while creating the combo box.
Though everything works fine when I don't set any font.

Since Substance 4.3RC the background of the editable combo box is white
and not in the color of our L&F (e.g. blue). With version 4.2 the
background is correct (in blue).

See the TestApp (ComboBoxTest.java) .

Editable combo box with font:
Exception in thread "main" java.lang.NullPointerException
    at
javax.swing.plaf.basic.BasicComboBoxUI.configureEditor(BasicComboBoxUI.java:738)
    at
org.jvnet.substance.SubstanceComboBoxUI.configureEditor(SubstanceComboBoxUI.java:705)
    at
javax.swing.plaf.basic.BasicComboBoxUI.addEditor(BasicComboBoxUI.java:695)
    at
javax.swing.plaf.basic.BasicComboBoxUI$Handler.propertyChange(BasicComboBoxUI.java:1604)
    at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:318)....

Non-editable combo box with font:
Exception in thread "main" java.lang.NullPointerException
    at
org.jvnet.substance.SubstanceComboBoxUI.getMinimumSize(SubstanceComboBoxUI.java:268)
    at
javax.swing.plaf.basic.BasicComboBoxUI.getPreferredSize(BasicComboBoxUI.java:865)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1632)
    at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:702)
    at java.awt.Container.preferredSize(Container.java:1616)
    at java.awt.Container.getPreferredSize(Container.java:1601)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)

Sometimes I get this Exception, but I don't know why:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at
org.jvnet.substance.SubstanceComboBoxUI$ComboBoxPropertyChangeHandler$2.run(SubstanceComboBoxUI.java:356)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Re: NPE in combo boxes with font

by T. Waligora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Kirill,
 
thanks for your reply. Now it works fine.
 
According to the second question, I attached a test app that shows the 
difference between version 4.2 and 4.3. The white background color of 
the selected text is also seen in other components (like text field or alike).
 
Do you have any idea? It is not really a problem, but I'm wondered about 
that.
 
Thanks
Tina
Mit freundlichen Grüßen
 


Kirill Grouchnikov schrieb:
Hi,

Your UI is not constructed on EDT. Changing the main method to respect the EDT rules fixes the NPE:

    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(new SubstanceRavenLookAndFeel());
        } catch (UnsupportedLookAndFeelException e) {
            System.out.println(e);
        }
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                new ComboBoxTest("Test");
            }
        });
    }

Regarding your second question - would you mind clarifying the "our L&F" part? Is it a custom L&F based on Substance, a custom Substance skin or something else? I would need to see a small test application that shows different behavior under 4.2 and 4.3

Thanks
Kirill

----- Original Message ----
From: T. Waligora tina.waligora@...
To: users@...
Sent: Wednesday, April 23, 2008 12:32:49 AM
Subject: NPE in combo boxes with font

Hi,
I have some problems with combo boxes in SubstanceRavenLookAndFeel. I
get NPE in SubstanceComboBoxUI (e.g. in the method "configureEditor" or
in "getMinimumSize") when I set a font while creating the combo box.
Though everything works fine when I don't set any font.

Since Substance 4.3RC the background of the editable combo box is white
and not in the color of our L&F (e.g. blue). With version 4.2 the
background is correct (in blue).

See the TestApp (ComboBoxTest.java) .

Editable combo box with font:
Exception in thread "main" java.lang.NullPointerException
    at
javax.swing.plaf.basic.BasicComboBoxUI.configureEditor(BasicComboBoxUI.java:738)
    at
org.jvnet.substance.SubstanceComboBoxUI.configureEditor(SubstanceComboBoxUI.java:705)
    at
javax.swing.plaf.basic.BasicComboBoxUI.addEditor(BasicComboBoxUI.java:695)
    at
javax.swing.plaf.basic.BasicComboBoxUI$Handler.propertyChange(BasicComboBoxUI.java:1604)
    at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    at
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:318)....

Non-editable combo box with font:
Exception in thread "main" java.lang.NullPointerException
    at
org.jvnet.substance.SubstanceComboBoxUI.getMinimumSize(SubstanceComboBoxUI.java:268)
    at
javax.swing.plaf.basic.BasicComboBoxUI.getPreferredSize(BasicComboBoxUI.java:865)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1632)
    at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:702)
    at java.awt.Container.preferredSize(Container.java:1616)
    at java.awt.Container.getPreferredSize(Container.java:1601)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)

Sometimes I get this Exception, but I don't know why:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at
org.jvnet.substance.SubstanceComboBoxUI$ComboBoxPropertyChangeHandler$2.run(SubstanceComboBoxUI.java:356)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

package de.or.console.test;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Vector;

import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.WindowConstants;

import org.jvnet.lafwidget.LafWidget;
import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.button.ClassicButtonShaper;
import org.jvnet.substance.painter.SimplisticGradientPainter;
import org.jvnet.substance.skin.SubstanceRavenLookAndFeel;
import org.jvnet.substance.theme.SubstanceComplexTheme;
import org.jvnet.substance.theme.SubstanceTheme;
import org.jvnet.substance.theme.SubstanceTheme.ThemeKind;
import org.jvnet.substance.utils.SubstanceConstants;
import org.jvnet.substance.watermark.SubstanceNoneWatermark;

public class ComboBoxTest extends JFrame {

    public static void main(String[] args)
    {
        try
        {
            initLaF();
        } catch (UnsupportedLookAndFeelException e)
        {
            System.out.println(e);
        }

        SwingUtilities.invokeLater(new Runnable() {

            public void run()
            {
                new ComboBoxTest("Test");
            }
        });
    }

    public static void initLaF() throws UnsupportedLookAndFeelException
    {
        UIManager.setLookAndFeel(new SubstanceRavenLookAndFeel());

        // DefaultTheme
        Color[] colors = { Color.white, new Color(150, 150, 150),
                new Color(170, 170, 170), new Color(130, 130, 130),
                new Color(100, 100, 100), new Color(76, 76, 76),
                new Color(101, 101, 101) };
        SubstanceTheme tintedRaven = new ColorTheme("DefaultTheme", colors);
        // active Theme
        Color[] activeColors = { Color.white, new Color(170, 170, 232),
                new Color(165, 165, 212), new Color(117, 120, 232),
                new Color(100, 100, 100), new Color(76, 76, 76),
                new Color(101, 101, 101) };
        SubstanceTheme active = new ColorTheme("ActiveTheme", activeColors);
        // disabled ColorScheme:
        Color[] disabledColors = { new Color(167, 167, 167),
                new Color(150, 150, 150), new Color(170, 170, 170),
                new Color(130, 130, 130), new Color(100, 100, 100),
                new Color(76, 76, 76), new Color(101, 101, 101) };
        SubstanceTheme disabled = new ColorTheme("DisabledTheme",
                disabledColors);

        SubstanceComplexTheme t = new SubstanceComplexTheme("all",
                ThemeKind.DARK, active, tintedRaven, disabled,
                tintedRaven.getActiveTitlePaneTheme());

        SubstanceRavenLookAndFeel.setCurrentTheme(t);
        SubstanceRavenLookAndFeel.setCurrentButtonShaper(new ClassicButtonShaper());
        SubstanceRavenLookAndFeel.setCurrentGradientPainter(new SimplisticGradientPainter());
        SubstanceRavenLookAndFeel.setCurrentWatermark(new SubstanceNoneWatermark());

        UIManager.put(SubstanceLookAndFeel.FOCUS_KIND,
                SubstanceConstants.FocusKind.NONE);

        UIManager.put(SubstanceLookAndFeel.BUTTON_NO_MIN_SIZE_PROPERTY,
                Boolean.TRUE);

        UIManager.put(LafWidget.COMBO_BOX_NO_AUTOCOMPLETION, Boolean.TRUE);
    }

    public ComboBoxTest(String title)
    {
        super(title);
        initGUI();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e)
            {
                System.exit(0);
            }
        });
        pack();
        setLocationRelativeTo(null);
        setVisible(true);
    }

    private void initGUI()
    {
        JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());
        Vector<String> boxVector = new Vector<String>();
        boxVector.add("Test 1");
        boxVector.add("Test 2");
        JComboBox comboBox = new JComboBox(boxVector);
        comboBox.setFont(new Font("Verdana", Font.PLAIN, 16));
        comboBox.setEditable(true);
        panel.add(comboBox, BorderLayout.CENTER);
        getContentPane().add(panel);
    }
}

package de.or.console.test;

import java.awt.Color;

import javax.swing.JComponent;

import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.color.ColorScheme;
import org.jvnet.substance.theme.SubstanceTheme;

public class ColorTheme extends SubstanceTheme {

    public void resetColorToDefault(JComponent button)
    {
        button.putClientProperty(SubstanceLookAndFeel.THEME_PROPERTY,
                SubstanceLookAndFeel.getTheme());
        button.repaint();
    }

    protected Color[] colors;

    public ColorTheme(String name, final Color[] colors)
    {
        super(new ColorScheme() {

            public Color getDarkColor()
            {
                return colors[5];
            }

            public Color getExtraLightColor()
            {
                return colors[2];
            }

            public Color getForegroundColor()
            {
                return colors[0];
            }

            public Color getLightColor()
            {
                return colors[3];
            }

            public Color getMidColor()
            {
                return colors[4];
            }

            public Color getUltraDarkColor()
            {
                return colors[6];
            }

            public Color getUltraLightColor()
            {
                return colors[1];
            }
        }, name, ThemeKind.DARK);
        this.colors = colors;
    }

    public void setTheme(JComponent boxButton, SubstanceTheme theme)
    {
        boxButton.putClientProperty(SubstanceLookAndFeel.THEME_PROPERTY, theme);
        boxButton.repaint();
    }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

Parent Message unknown Re: NPE in combo boxes with font

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

Thanks for the example. I've reworked it a little bit to follow the recommended approach of extracting the various definitions into a custom skin (this would also make it much easier for you to migrate to version 5.0). The existing core computation of selected background color may have indeed been changed in between 4.2 and 4.3 to better accomodate core skins. You can override the getSelectionBackgroundColor() of your main theme to have full control over the exact background color of text field selections.

Thanks
Kirill

package test.contrib.combotheme;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Vector;

import javax.swing.*;

import org.jvnet.lafwidget.LafWidget;
import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.border.GlassBorderPainter;
import org.jvnet.substance.button.ClassicButtonShaper;
import org.jvnet.substance.painter.AlphaControlBackgroundComposite;
import org.jvnet.substance.painter.SimplisticGradientPainter;
import org.jvnet.substance.painter.decoration.ArcDecorationPainter;
import org.jvnet.substance.painter.highlight.ClassicHighlightPainter;
import org.jvnet.substance.skin.SubstanceAbstractSkin;
import org.jvnet.substance.theme.SubstanceComplexTheme;
import org.jvnet.substance.theme.SubstanceTheme;
import org.jvnet.substance.theme.SubstanceTheme.ThemeKind;
import org.jvnet.substance.utils.SubstanceConstants;
import org.jvnet.substance.watermark.SubstanceNoneWatermark;

public class ComboBoxTestNew extends JFrame {

    public static void main(String[] args) {
        try {
            initLaF();
        } catch (UnsupportedLookAndFeelException e) {
            System.out.println(e);
        }

        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                new ComboBoxTestNew("Test");
            }
        });
    }

    protected static class CustomSkin extends SubstanceAbstractSkin {
        public String getDisplayName() {
            return "Custom";
        }

        public CustomSkin() {
            super();
            // DefaultTheme
            Color[] colors = { Color.white, new Color(150, 150, 150),
                    new Color(170, 170, 170), new Color(130, 130, 130),
                    new Color(100, 100, 100), new Color(76, 76, 76),
                    new Color(101, 101, 101) };
            SubstanceTheme tintedRaven = new ColorTheme("DefaultTheme", colors);
            // active Theme
            Color[] activeColors = { Color.white, new Color(170, 170, 232),
                    new Color(165, 165, 212), new Color(117, 120, 232),
                    new Color(100, 100, 100), new Color(76, 76, 76),
                    new Color(101, 101, 101) };
            SubstanceTheme active = new ColorTheme("ActiveTheme", activeColors);
            // disabled ColorScheme:
            Color[] disabledColors = { new Color(167, 167, 167),
                    new Color(150, 150, 150), new Color(170, 170, 170),
                    new Color(130, 130, 130), new Color(100, 100, 100),
                    new Color(76, 76, 76), new Color(101, 101, 101) };
            SubstanceTheme disabled = new ColorTheme("DisabledTheme",
                    disabledColors);

            this.theme = new SubstanceComplexTheme("all", ThemeKind.DARK,
                    active, tintedRaven, disabled, tintedRaven
                            .getActiveTitlePaneTheme()) {
                @Override
                public Color getSelectionBackgroundColor() {
                    return new Color(170, 170, 232);
                }
            };

            this.buttonShaper = new ClassicButtonShaper();
            this.gradientPainter = new SimplisticGradientPainter();
            this.watermark = new SubstanceNoneWatermark();
            this.decorationPainter = new ArcDecorationPainter();
            this.highlightPainter = new ClassicHighlightPainter();
            tabBackgroundComposite = new AlphaControlBackgroundComposite(0.5f);
            this.borderPainter = new GlassBorderPainter();
        }
    }

    protected static class MyCustomLookAndFeel extends SubstanceLookAndFeel {
        @Override
        public String getID() {
            return "Custom";
        }

        @Override
        public String getName() {
            return "Custom";
        }

        @Override
        public void initialize() {
            super.initialize();
            setSkin(new CustomSkin());
        }
    }

    public static void initLaF() throws UnsupportedLookAndFeelException {
        UIManager.setLookAndFeel(new MyCustomLookAndFeel());

        UIManager.put(SubstanceLookAndFeel.FOCUS_KIND,
                SubstanceConstants.FocusKind.NONE);

        UIManager.put(SubstanceLookAndFeel.BUTTON_NO_MIN_SIZE_PROPERTY,
                Boolean.TRUE);

        UIManager.put(LafWidget.COMBO_BOX_NO_AUTOCOMPLETION, Boolean.TRUE);
    }

    public ComboBoxTestNew(String title) {
        super(title);
        initGUI();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
        pack();
        setLocationRelativeTo(null);
        setVisible(true);
    }

    private void initGUI() {
        JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());
        Vector<String> boxVector = new Vector<String>();
        boxVector.add("Test 1");
        boxVector.add("Test 2");
        JComboBox comboBox = new JComboBox(boxVector);
        comboBox.setFont(new Font("Verdana", Font.PLAIN, 16));
        comboBox.setEditable(true);
        panel.add(comboBox, BorderLayout.CENTER);
        getContentPane().add(panel);
    }
}



Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Re: NPE in combo boxes with font

by T. Waligora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Kirill,

thanks for all. Everything works fine. Substance is really great.

I'm looking forward to version 5.0.

Special thanks,
Tina


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Parent Message unknown Re: NPE in combo boxes with font

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I'm glad to hear this.

Thanks
Kirill

----- Original Message ----
From: T. Waligora <tina.waligora@...>
To: users@...
Sent: Friday, April 25, 2008 1:44:05 AM
Subject: Re: NPE in combo boxes with font

Hi Kirill,

thanks for all. Everything works fine. Substance is really great.

I'm looking forward to version 5.0.

Special thanks,
Tina


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...




Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
LightInTheBox - Buy quality products at wholesale price!