Skip to main content

Need access to Graphics2D

2 replies [Last post]
vmatters
Offline
Joined: 2006-08-03
Points: 0

I need to draw thousands of lines on the Scene. I need direct drawing access using Graphics2D object. Does JavaFx expose and instance of Graphics via any of the Node components? If not, this is sorely needed as adding too many object to Scene:content will throw array out of bound exceptions (since each line is an object and lingers in memory). Having direct graphics access will bypass that limitation.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
michael_heinrichs
Offline
Joined: 2007-11-15
Points: 0

AFAIK this is not supported (except you want to use some dirty hacks maybe...)

I'd recommend to do the drawing on a SwingComponent in Java directly and add that component to your scene.

vmatters
Offline
Joined: 2006-08-03
Points: 0

Michael,
Thanks for the tip. I did not even think about doing my drawing on a Swing component and add it to my scene.