This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 20728 - NPE in o.n.m.f.palette.CPComponentLarge$PaletteListRenderer
Summary: NPE in o.n.m.f.palette.CPComponentLarge$PaletteListRenderer
Status: VERIFIED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Tomas Pavek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-20 21:11 UTC by Jan Kuemmel
Modified: 2005-07-11 12:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kuemmel 2002-02-20 21:11:37 UTC
org.netbeans.modules.form.palette.CPComponentLarge$PaletteListRenderer

1.
crashes with NPE when ui default for "Button.border" is null. This can happen
using certain look&feels(including the one I am developing at the moment).

The following change would have no impact on the default look&feels, but would
work wonderful (instead of crashing) with several other look&feels:

 public PaletteListRenderer() {
    ...
    buttonBorder = button.getBorder();
    if (buttonBorder != null) {
      emptyBorder = new EmptyBorder(buttonBorder.getBorderInsets(button));
    } 
    ...


2.
If the look&feel defines a minimum width for buttons which exceeds the palette
icons, the left alignment looks awful.

Workaround: setting to center alignment

     public void setIconSize(int size) {
        if (size == BeanInfo.ICON_COLOR_16x16) {
/* --> */  button.setHorizontalAlignment(SwingConstants.CENTER); // changed this
           button.setVerticalTextPosition(SwingConstants.CENTER);
           button.setHorizontalTextPosition(SwingConstants.RIGHT);
        } else {
...
Comment 1 Tomas Pavek 2002-04-19 13:28:08 UTC
Looks reasonably, I'm going to apply it.
Comment 2 Tomas Pavek 2002-04-19 13:42:44 UTC
But the alignment must stay left if "show names" is set...
Comment 3 Tomas Pavek 2002-04-19 16:05:19 UTC
Fixed in dev trunk.
Comment 4 Marek Grummich 2005-07-11 12:49:59 UTC
Verified