Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.4K Development
- 17 Developer Projects
- 139 Programming Languages
- 293.1K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 161 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 475 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Applet and css

870573
Member Posts: 3
In an applet, StyleManager.loadStylesheet(final String fname) causes a null exception .
The code below evade this :
StyleManager styleManager= StyleManager.getInstance();
URL url=getURL("/indicateurs/charts.css", Main.class);
try {
Stylesheet stylesheet = CSSParser.getInstance().parse(url);
styleManager.setUserAgentStylesheet(stylesheet);
} catch (IOException ex) {
System.out.println("exception:"+e);
}
In the css file indicateurs.charts.css , i add first the source of : sun.javafx.scene.control.skin.caspian.caspian.css (as the setUserAgentStylesheet erase the others stylesheet !!!)
Will there be a more simple way to deal with the css in an applet ?
thanks
Edited by: 867570 on 22 juin 2011 02:16
The code below evade this :
StyleManager styleManager= StyleManager.getInstance();
URL url=getURL("/indicateurs/charts.css", Main.class);
try {
Stylesheet stylesheet = CSSParser.getInstance().parse(url);
styleManager.setUserAgentStylesheet(stylesheet);
} catch (IOException ex) {
System.out.println("exception:"+e);
}
In the css file indicateurs.charts.css , i add first the source of : sun.javafx.scene.control.skin.caspian.caspian.css (as the setUserAgentStylesheet erase the others stylesheet !!!)
Will there be a more simple way to deal with the css in an applet ?
thanks
Edited by: 867570 on 22 juin 2011 02:16
Tagged:
Answers
-
867570 wrote:What's a <tt>StyleManager</tt>? I don't see it in the Java 6 JavaDocs.
In an applet, StyleManager.loadStylesheet(final String fname) causes a null exception .The code below evade this :What <tt>URL</tt> constructor takes a <tt>String</tt> and ..what is that, a <tt>Class</tt>?
StyleManager styleManager= StyleManager.getInstance();
URL url=getURL("/indicateurs/charts.css", Main.class);} catch (IOException ex) {Don't throw away exception information. Call <tt>e.printStackTrace()</tt>. Even if you choose to dump part of the message to output, <tt>System.err</tt> rather than <tt>System.out</tt> should be used.
System.out.println("exception:"+e);Will there be a more simple way to deal with the css in an applet ?Can you:
<li>Use the code formatting tags as described on the sticky post at the top of the forum thread listing?
<li>Ask a smart question? The current code & text reads like nonsense. -
it is in the javafx general Question :
StyleManager is from the package : com.sun.javafx.css -
Packages in com.sun are usually intended as implementation or experimentation. Using them in your own projects is not recommended. As for using CSS in an applet, you should be able to do that without having to resort to those packages. The tutorial on CSS is right here: http://download.oracle.com/javafx/2.0/css_tutorial/jfxpub-css_tutorial.htm
-
I am interested in knowing what the traceback of the NPE is so I can see if it is a bug in the code. Thanks.
-
I would guess it's just a result of the security manager preventing the applet from accessing files on the local filesystem.
db -
when the code is :
Scene scene = new Scene(root);
scene.getStylesheets().addAll("/indicateurs/charts.css");
the message from the console java is :
WARNING: com.sun.javafx.css.StyleManager$2 run Resource "null" not found.
SEVERE: javafx.scene.control.Control impl_processCSS The -fx-skin property has not been defined in CSS for [email protected][styleClass=sample-tile]
SEVERE: javafx.scene.control.Control impl_processCSS The -fx-skin property has not been defined in CSS for [email protected][styleClass=sample-tile]
thanks for your help
This discussion has been closed.