Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot use TreeTableView -throws java.lang.IllegalStateException: Toolkit not initialized

922980Nov 21 2014 — edited Nov 24 2014

In the (PDF version) of the Oracle document:


  JavaFX

  Working with JavaFX UI Components Release 8

  E47848-02

  August 2014

there is source code for TreeTableViewSample:

TreeTableViewSample.java  (page A-29)

TreeTableView is a recent JavaFX component that would be of great use to me.

I used

  my Mac PowerBook, OS 10.10.1

  $java -version

  java version "1.8.0"

  Java(TM) SE Runtime Environment (build 1.8.0-b132)

  Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

  NetBeans 8.0.1

  (no NetBeans updates available)

TreeTableViewSample.java threw an exception.

So I created a trivial project in NetBeans

  package ttv;

  import javafx.scene.control.TreeTableView;

  public class TTV {

  public static void main(String[] args) {

  TreeTableView ttv = new TreeTableView();

  }

  }

Note that NetBeans was OK with my import statement.

I created both a JavaFX version of the project and a vanilla Java version.

In both cases I got this exception:

  Exception in thread "main" java.lang.ExceptionInInitializerError

  at ttvx.TTVX.main(TTVX.java:17)

  Caused by: java.lang.IllegalStateException: Toolkit not initialized

  at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:276)

  at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:271)

  at com.sun.javafx.application.PlatformImpl.setPlatformUserAgentStylesheet(PlatformImpl.java:562)

  at com.sun.javafx.application.PlatformImpl.setDefaultPlatformUserAgentStylesheet(PlatformImpl.java:524)

  at javafx.scene.control.Control.<clinit>(Control.java:81)

  ... 1 more

  Java Result: 1

Curious that it mentioned javafx.scene.control.Control.<clinit>(Control.java:81)

even in my plain vanilla Java project.

The pages I found online about this exception focused on Debug.

where it was claimed that that the Toolkit not initialized bug was fixed.

Please deconfusealate me.

- Bob

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2014
Added on Nov 21 2014
4 comments
3,106 views