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 231662 - NullPointerException thrown when (node piechart).setLabelsVisable(false) is called
Summary: NullPointerException thrown when (node piechart).setLabelsVisable(false) is c...
Status: RESOLVED WORKSFORME
Alias: None
Product: javafx
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Petr Somol
URL:
Keywords: USABILITY
Depends on:
Blocks:
 
Reported: 2013-06-21 20:42 UTC by JBKMG
Modified: 2013-06-24 18:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (55.86 KB, text/plain)
2013-06-21 20:42 UTC, JBKMG
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JBKMG 2013-06-21 20:42:47 UTC
Product Version = NetBeans IDE 7.3 (Build 201306052037)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.7.0_13
Runtime = Java HotSpot(TM) Client VM 23.7-b01

In Oracles sample programs, An application called Ensemble is included.

If I open the project folder, and load the Ensemble project it seems to compile correctly.

Executing com.javafx.main.Main from C:\Users\~\javafx_samples-2_2_25-windows\javafx-samples-2.2.25\src\Ensemble\dist\run801907948\Ensemble.jar using platform C:\Program Files\Java\jdk1.7.0_07/bin/java

Upon execution, if I navigate to the Samples, and select the 'advanced Pie Chart' it will correctly present the chart.

The exception is thrown when I navigate to the 'Chart Properties' accordian pane (on bottom right).  I then select PieChart Properties dropdown. There is a checkbox that will un-set Labels Visable. 

If this is unchecked, the exception is thrown and the application is frozen on the thread.

Also I wrote my own class utilizing the PieChart api, is too fails with the addition of this line = pieChart.setLabelsVisible(false);



I do not think this is a java bug as the pre-compiled example application; downloaded directly from Oracle, will not exhibit this behavior and functions as intended.

Put another way; when I execute the Ensemble.jar file included with the samples, it functions as intended.  When I load the project into netbeans, compile, and execute, It fails.

All vendors' updates are current as of June 21 2013.

Please advise.
Comment 1 JBKMG 2013-06-21 20:42:52 UTC
Created attachment 136167 [details]
IDE log
Comment 2 Petr Somol 2013-06-24 15:48:55 UTC
I downloaded the current JavaFX samples distribution from oracle.com (javafx_samples-2_2_25-windows) and unpacked it. The I opened NetBeans 7.3 (running on JDK 7u25, also downloaded/installed today from oracle.com). In NetBeans I opened the Ensemble project, built it and run it. The problem was not reproducible, I could see no crash when unchecking Labels Visible, instead it just hide the labels as expected.

I am almost sure the problem on your side is your JDK version. If you run the Ensemble.jar from the distribution, your Java runtime version 7u13 apparently runs it correctly. But the JDK 7u13 compiler that comes into play when you build Ensemble in NetBeans is apparently failing to produce the correct jar. This is not unexpected, because from the point of view of quick JavaFX development 7u13 is already outdated. It is generally not guaranteed that a newer JavaFX code will compile and run correctly with outdated JDKs, but that is your case. The current JavaFX Samples distribution version 2.2.25 has been tested, as far as I know, to work correctly with the current JDK 7u25. Note that Ensemble evolves internally inbetween JDK updates, co the older version available at the time when JDK 7u13 was current probably did work with it and may even have looked the same, but the code has definitely been changed, mostly by fixing bugs but also by updating some coding patterns etc. To summarize, I am closing the bug because I could not reproduce it with the recommended JDK/samples version setup.

Also, I am downgrading to P3 as the bug is not present in NetBeans codebase and has not even been in code distributed with NetBeans.
Comment 3 JBKMG 2013-06-24 18:55:35 UTC
I would like to thank you for your effort.  I had not realized the mistake.  

Although I had current 7.0_25 on my system, I had not properly directed Netbeans away from the previous JDK on one of our workstations.

I edited netbeans.conf to change my default JDK to ~7.0_25 and reloaded the Default JavaFX Platform.  

After these actions, I was unable to reproduce the error.

I apologize for erroneously submitting and stating that all vendor updates were current.

Again thank you for your timely response, and continued open support of NetBeans IDE.