Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaFX - CSS can't be load in Linux
    primarykey
    data
    text
    <p>I'm using JavaFX to develop a multiplatform application and I'm using Win7 with Netbeans 7.2.1 with JavaFX 2.2 and Java 1.7u21 (previously using 1.7u9 and working great too). As I said, Win7 is running just fine my app. When I try to run it on Ubuntu 12.04, it simply can't load my CSS styles. Every fxml file has its control's stylesheet classes added. And then every control has it style added. For example: on a blank button, I'm applying this style:</p> <p>buttonStyle.css:</p> <pre><code>.button { -fx-text-fill: white; -fx-alignment: CENTER; -fx-border-radius: 5; -fx-font-size: 13pt; -fx-font-family: "Verdana"; -fx-font-weight: bold; -fx-background-color: linear-gradient(#328BDB 0%, #207BCF 25%, #1973C9 75%, #0A65BF 100%); } .button:hover { -fx-background-color: linear-gradient(#2C8AE7 0%, #0C6AC7 25%, #0A58A5 75%, #093B6D 100%); } .button:pressed { -fx-background-color: linear-gradient(#328BDB 0%, #207BCF 25%, #1973C9 75%, #0A65BF 100%); } </code></pre> <p>On Win7 works fine but it generate the following exception on Ubuntu:</p> <p><code> java.lang.ClassNotFoundException: AUTHOR Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.javafx.main.Main.launchApp(Main.java:642) at com.javafx.main.Main.main(Main.java:805) Caused by: java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403) at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47) at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.ArrayIndexOutOfBoundsException: 512 at com.sun.javafx.css.StyleConverter.readBinary(StyleConverter.java:99) at com.sun.javafx.css.ParsedValue.readBinary(ParsedValue.java:600) at com.sun.javafx.css.Declaration.readBinary(Declaration.java:142) at com.sun.javafx.css.Rule.readBinary(Rule.java:189) at com.sun.javafx.css.Stylesheet.readBinary(Stylesheet.java:185) at com.sun.javafx.css.Stylesheet.loadBinary(Stylesheet.java:215) at com.sun.javafx.css.StyleManager.loadStylesheetUnPrivileged(StyleManager.java:572) at com.sun.javafx.css.StyleManager.loadStylesheet(StyleManager.java:411) at com.sun.javafx.css.StyleManager.access$1900(StyleManager.java:72) at com.sun.javafx.css.StyleManager$StylesheetContainer.gatherParentStylesheets(StyleManager.java:1140) at com.sun.javafx.css.StyleManager$StylesheetContainer.getStyleHelper(StyleManager.java:1225) at com.sun.javafx.css.StyleManager$StylesheetContainer.access$1300(StyleManager.java:1031) at com.sun.javafx.css.StyleManager.getStyleHelper(StyleManager.java:968) at javafx.scene.Node.impl_createStyleHelper(Node.java:7433) at javafx.scene.Node.impl_processCSS(Node.java:7403) at javafx.scene.Parent.impl_processCSS(Parent.java:1146) at javafx.scene.Parent.impl_processCSS(Parent.java:1153) at javafx.scene.Parent.impl_processCSS(Parent.java:1153) at javafx.scene.Node.processCSS(Node.java:7383) at javafx.scene.Scene.doCSSPass(Scene.java:443) at javafx.scene.Scene.preferredSize(Scene.java:1445) at javafx.scene.Scene.impl_preferredSize(Scene.java:1512) at javafx.stage.Window$10.invalidated(Window.java:719) at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:127) at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:161) at javafx.stage.Window.setShowing(Window.java:782) at javafx.stage.Window.show(Window.java:797) at javafx.stage.Stage.show(Stage.java:229) at com.test.MainInterface.start(MainInterface.java:62) at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319) at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206) at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76) at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82) ... 1 more </code></p> <p>Removing buttonStyle.css and adding comboStyle.css, the following exception is thrown:</p> <p>comboStyle.css:</p> <pre><code>.combo-box { -fx-font: 13pt "Verdana"; -fx-alignment: baseline-left; -fx-background-color: linear-gradient(#328BDB 0%, #207BCF 25%, #1973C9 75%, #0A65BF 100%); } .combo-box .text { -fx-fill: white; } .combo-box .arrow-button { -fx-background-color: linear-gradient(#328BDB 0%, #207BCF 25%, #1973C9 75%, #0A65BF 100%); } .combo-box .arrow { -fx-background-color: white; } </code></pre> <p>Exception: <code>java.io.EOFException at java.io.DataInputStream.readByte(DataInputStream.java:267) at com.sun.javafx.css.CompoundSelector.readBinary(CompoundSelector.java:351) at com.sun.javafx.css.Selector.readBinary(Selector.java:113) at com.sun.javafx.css.CompoundSelector.readBinary(CompoundSelector.java:344) at com.sun.javafx.css.Selector.readBinary(Selector.java:113) at com.sun.javafx.css.Rule.readBinary(Rule.java:182) at com.sun.javafx.css.Stylesheet.readBinary(Stylesheet.java:185) at com.sun.javafx.css.Stylesheet.loadBinary(Stylesheet.java:215) at com.sun.javafx.css.StyleManager.loadStylesheetUnPrivileged(StyleManager.java:572) at com.sun.javafx.css.StyleManager.loadStylesheet(StyleManager.java:411) at com.sun.javafx.css.StyleManager.access$1900(StyleManager.java:72) at com.sun.javafx.css.StyleManager$StylesheetContainer.gatherParentStylesheets(StyleManager.java:1140) at com.sun.javafx.css.StyleManager$StylesheetContainer.getStyleHelper(StyleManager.java:1225) at com.sun.javafx.css.StyleManager$StylesheetContainer.access$1300(StyleManager.java:1031) at com.sun.javafx.css.StyleManager.getStyleHelper(StyleManager.java:968) at javafx.scene.Node.impl_createStyleHelper(Node.java:7433) at javafx.scene.Node.impl_processCSS(Node.java:7403) at javafx.scene.Parent.impl_processCSS(Parent.java:1146) at javafx.scene.Parent.impl_processCSS(Parent.java:1153) at javafx.scene.Parent.impl_processCSS(Parent.java:1153) at javafx.scene.Node.processCSS(Node.java:7383) at javafx.scene.Scene.doCSSPass(Scene.java:443) at javafx.scene.Scene.preferredSize(Scene.java:1445) at javafx.scene.Scene.impl_preferredSize(Scene.java:1512) at javafx.stage.Window$10.invalidated(Window.java:719) at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:127) at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:161) at javafx.stage.Window.setShowing(Window.java:782) at javafx.stage.Window.show(Window.java:797) at javafx.stage.Stage.show(Stage.java:229) at com.test.MainInterface.start(MainInterface.java:62) at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319) at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206) at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76) at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82) at java.lang.Thread.run(Thread.java:722) </code></p> <p>Any idea why are those styles can't be loaded in Linux?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload