Java Fx Problem TimeSeriesChartFXDemo1

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
azorek
Posts: 1
Joined: Thu Nov 19, 2015 1:30 am
antibot: No, of course not.

Java Fx Problem TimeSeriesChartFXDemo1

Post by azorek » Thu Nov 19, 2015 1:35 am

Hi,
I would like to use JFreeChart witch javaFx. I change method "protected getUserAgentStylesheet" to "public getUserAgentStylesheet" then I successfully build project with ant. But when I would like to run TimeSeriesChartFXDemo1 I get error:

Code: Select all

Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$156(LauncherImpl.java:182)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at org.jfree.chart.fx.ChartViewer.getUserAgentStylesheet(ChartViewer.java:124)
	at com.sun.javafx.css.StyleManager.findMatchingStyles(StyleManager.java:1665)
	at javafx.scene.CssStyleHelper.createStyleHelper(CssStyleHelper.java:111)
	at javafx.scene.Node.reapplyCss(Node.java:8983)
	at javafx.scene.Node.impl_reapplyCSS(Node.java:8946)
	at javafx.scene.Node.invalidatedScenes(Node.java:854)
	at javafx.scene.Node.setScenes(Node.java:919)
	at javafx.scene.Scene$9.invalidated(Scene.java:1119)
	at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:111)
	at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
	at javafx.scene.Scene.setRoot(Scene.java:1072)
	at javafx.scene.Scene.<init>(Scene.java:347)
	at javafx.scene.Scene.<init>(Scene.java:194)
	at org.jfree.chart.fx.demo.TimeSeriesChartFXDemo1.start(TimeSeriesChartFXDemo1.java:433)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$163(LauncherImpl.java:863)
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$176(PlatformImpl.java:326)
	at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
	... 1 more

EDIT

Demo class is still not working. In my newJava FX project I copy jar files and everythink is seems to work now :)

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Java Fx Problem TimeSeriesChartFXDemo1

Post by david.gilbert » Tue Nov 24, 2015 5:51 pm

I'd guess that the chart-viewer.css file is not found. Do you see it in the jar file?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked