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 130221 - [NIMBUS] NPE at sun.font.FontDesignMetrics$MetricsKey.init
Summary: [NIMBUS] NPE at sun.font.FontDesignMetrics$MetricsKey.init
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL: http://statistics.netbeans.org/except...
Keywords:
: 134821 (view as bug list)
Depends on:
Blocks: 120656
  Show dependency tree
 
Reported: 2008-03-15 16:19 UTC by lhochet
Modified: 2008-05-19 14:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 37021


Attachments
stacktrace (3.54 KB, text/plain)
2008-03-15 16:19 UTC, lhochet
Details
Flash movie of the steps used to reproduce the issue (1.38 MB, application/octet-stream)
2008-05-11 14:08 UTC, lhochet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lhochet 2008-03-15 16:19:03 UTC
Build: NetBeans IDE 6.1 Beta (Build 200803050202)
VM: Java HotSpot(TM) Client VM, 11.0-b11
OS: Windows Vista, 6.0, x86

User Comments: 
previewing the design of a panel using Nimbuz L&F
Comment 1 lhochet 2008-03-15 16:19:08 UTC
Created attachment 58431 [details]
stacktrace
Comment 2 Lukas Hasik 2008-03-17 13:42:11 UTC
what JDK are you using? Is it jdk1.6.0_11? VM: Java HotSpot(TM) Client VM, 11.0-b11
Comment 3 lhochet 2008-03-17 23:06:45 UTC
I'm using JDK 1.6.0 u10 beta b13
Comment 4 mslama 2008-03-31 15:27:46 UTC
Please can you send me panel (minimum project) I can use to reproduce this?
Comment 5 lhochet 2008-03-31 21:43:43 UTC
I can reproduce it by creating a new Java Desktop Application project (leaving all defaults),
then right clicking on [FrameView] for the DesktopApplication1View that opened automatically,
then "Preview Design"|Nimbus,
then in the preview I click on File,
then on the File menu, I move the mouse of Exit, and I have the exception
Comment 6 Lukas Hasik 2008-04-10 21:21:47 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 7 mslama 2008-04-24 15:01:23 UTC
I cannot reproduce this issue with latest JDK 6u10 b22. Please test again. But there is different issue I am
investigating now. Problem is when opening Properties window.
Comment 8 mslama 2008-04-24 17:14:15 UTC
Issue filed as #133852.
Comment 9 lhochet 2008-04-26 20:14:05 UTC
Netbeans 6.1 RC2 with JDK 6u10 b22: no change, I can still reproduce the issue
Comment 10 mslama 2008-04-29 12:18:41 UTC
I tried both with trunk build and 6.1 and no exception with JDK 6u10 b22. Please use trunk build with Nimbus L&F. NB 6.1
does not support it. I just fixed #133852 hopefully it will get into main and tomorrow daily trunk build. I pushed fix
to core-main.

I am not able to reproduce with given steps even on Vista 32bit and JDK 6u10 b22, latest trunk build. Please give steps
to reproduce this issue. Otherwise it looks like specific to your configuration. (Different fonts,.... no idea what
could cause it.)
Comment 11 mslama 2008-04-29 12:27:30 UTC
Exception comes from TabbedPaneUI so it looks like you have JTabbedPane somewhere. And eventually with non default font.
If you run JTabbedPane demo do you have the same exception?
Comment 12 lhochet 2008-05-11 11:28:48 UTC
*** Issue 134821 has been marked as a duplicate of this issue. ***
Comment 13 lhochet 2008-05-11 14:08:35 UTC
Created attachment 61227 [details]
Flash movie of the steps used to reproduce the issue
Comment 14 lhochet 2008-05-11 14:21:00 UTC
I don't see what you mean by the "JTabbedPane demo"? 
From the look of it there is no JTabbedPane in the default desktop application however.
In order to check if this was specific to my system I've reproduced the steps on a VM copy of Vista SP1 + JDK 1.6.0_10
b23 + NetBeans Dev Build 200805101202, the issue also occurs there (see the flash attachement), Vista is a stock Vista
using the basic L&F due to a short amount of RAM available to the VM (1Gb), on my proper system, it run the full Aero
L&F (with a 1680x1050 resolution).
I have also reproduced it on XP SP2 (physical machine)+ JDK 1.6.0_10 b23 + NetBeans Dev Build 200805101202 (see Issue
134821).
Comment 15 mslama 2008-05-12 11:32:14 UTC
I see it now. It does not work even on Linux (#134846, #134868). 2 important things to reproduce not clearly said:
1.IDE itself runs in default L&F ie. NOT Nimbus so preview is run in different L&F.
2.[FrameView] node is in *Inspector* window. But I invoked preview using icon Preview Design from editor toolbar.

Passing to from if problem is on our side or if it is JDK/Swing issue.
Comment 16 mslama 2008-05-12 11:33:24 UTC
Correction: Referenced issues are issue #134846 and issue #134848.
Comment 17 Jan Stola 2008-05-13 08:34:22 UTC
The problem was caused by missing "defaultFont" key in UIDefaults. This key is needed by many UI delegates in Nimbus 
look and feel. Unfortunately, there are some places not covered by our preview blocks that needs this key. Happily, it 
seems that this key is not used by anyone else and it is possible to add it without any consequences into IDE defaults. 
So, it should be fixed by now.

Modified file: http://hg.netbeans.org/main/rev/19e15af84fe2
Comment 18 mslama 2008-05-14 09:02:33 UTC
For Nimbus L&F I am now working on change of font size. I was told by Nimbus team to modify defaultFont so on Nimbus
this key is used. Unfortunately modifying this key does not have desired effect on font size.
Comment 19 Jan Stola 2008-05-14 10:15:42 UTC
> I was told by Nimbus team to modify defaultFont so on Nimbus this key is used.

That should be fine, we don't do the mentioned changes when the IDE is running on Nimbus look and feel. The problem was 
that there were no value for "defaultFont" key in UIManager when running the IDE on other look and feels. So, if the 
IDE is running on Nimbus then we (=preview, not you=the rest of the IDE) obtain an inaccurate value in the worst case - 
still much better then throwing an exception.
Comment 20 lhochet 2008-05-19 14:50:40 UTC
> I see it now. It does not work even on Linux (#134846, #134868). 2 important things to reproduce not clearly said:
Apologies, I'll try to be more precise next time