Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 585 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 46 Data Integration
- 46 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 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
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 667 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 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.