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!

Reading CSS file from Applet

661933Sep 22 2011 — edited Sep 23 2011
Does anyone have any idea how to load a CSS file from an applet (or as a webstart)? I have no problems accessing the style sheets, via scene.getStylesheets().add(<stylesheet>), when I run my application as standalone but as soon as I convert to an applet and/or webstart application I can no longer get the style sheet. I have read the tutorial and tried a myriad of other options but with no luck.
This post has been answered by MiPa on Sep 23 2011
Jump to Answer

Comments

MiPa
Answer
Have you tried it this way?
scene.getStylesheets().add(FXMLSample1.class.getResource("/layouttests/fxml/sample1/FXMLSample1RootPane.css").toExternalForm());	
Marked as Answer by 661933 · Sep 27 2020
661933
Nope, hadn't tried that. Worked like a charm! Thank you very much!
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 21 2011
Added on Sep 22 2011
2 comments
164 views