java.lang.NoSuchMethodError using jfreechart-fx

A discussion forum for FXGraphics2D (adds a Java2D API to the JavaFX Canvas).
Post Reply
andreabonus
Posts: 1
Joined: Tue Jun 04, 2019 10:17 am
antibot: No, of course not.

java.lang.NoSuchMethodError using jfreechart-fx

Post by andreabonus » Tue Jun 04, 2019 10:23 am

Hello!!
I'm new to this forum...
I'm facing a strange issue: I get a java.lang.NoSuchMethodError: javafx.scene.text.Font.impl_getNativeFont() error message while running my javafx-maven application on NetBeans 11, using Java JDK12.
The matter is that I can't figure what is the problem... Here follows the full stack trace:

Code: Select all

Exception in thread "JavaFX Application Thread" java.lang.NoSuchMethodError: javafx.scene.text.Font.impl_getNativeFont()Ljava/lang/Object;
	at org.jfree.fx.FXFontMetrics.getStringBounds(FXFontMetrics.java:108)
	at org.jfree.fx.FXFontMetrics.stringWidth(FXFontMetrics.java:116)
	at org.jfree.chart.text.TextUtils.getTextBounds(TextUtils.java:280)
	at org.jfree.chart.text.G2TextMeasurer.getStringWidth(G2TextMeasurer.java:64)
	at org.jfree.chart.text.TextUtils.nextLineBreak(TextUtils.java:227)
	at org.jfree.chart.text.TextUtils.createTextBlock(TextUtils.java:168)
	at org.jfree.chart.title.TextTitle.arrangeRR(TextTitle.java:628)
	at org.jfree.chart.title.TextTitle.arrange(TextTitle.java:496)
	at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1370)
	at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1260)
	at org.jfree.chart.fx.ChartCanvas.draw(ChartCanvas.java:506)
	at org.jfree.chart.fx.ChartCanvas.lambda$new$1(ChartCanvas.java:165)
	at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:136)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.property.DoublePropertyBase.fireValueChangedEvent(DoublePropertyBase.java:107)
	at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:114)
	at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:148)
	at javafx.scene.canvas.Canvas.setHeight(Canvas.java:221)
	at org.jfree.chart.fx.ChartViewer.layoutChildren(ChartViewer.java:195)
	at javafx.scene.Parent.layout(Parent.java:1206)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Parent.layout(Parent.java:1213)
	at javafx.scene.Scene.doLayoutPass(Scene.java:576)
	at javafx.scene.Scene.preferredSize(Scene.java:1748)
	at javafx.scene.Scene$2.preferredSize(Scene.java:393)
	at com.sun.javafx.scene.SceneHelper.preferredSize(SceneHelper.java:66)
	at javafx.stage.Window$12.invalidated(Window.java:1086)
	at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
	at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
	at javafx.stage.Window.setShowing(Window.java:1174)
	at javafx.stage.Window.show(Window.java:1189)
	at javafx.stage.Stage.show(Stage.java:273)
	at org.ingv.pickfx.MapFormController.ShowWavesWindow(MapFormController.java:1183)
	at org.ingv.pickfx.MapFormController$7.handle(MapFormController.java:1136)
	at org.ingv.pickfx.MapFormController$7.handle(MapFormController.java:1132)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.concurrent.EventHelper.fireEvent(EventHelper.java:219)
	at javafx.concurrent.Task.fireEvent(Task.java:1358)
	at javafx.concurrent.Task.setState(Task.java:725)
	at javafx.concurrent.Task$TaskCallable.lambda$call$1(Task.java:1436)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
Any idea??
THANKS IN ADVANCE!!

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

Re: java.lang.NoSuchMethodError using jfreechart-fx

Post by david.gilbert » Mon Jul 01, 2019 2:14 am

At first glance this appears to be a bug in JavaFX. Did you try running it on Java 9 for a comparison?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited

Post Reply