Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8125865

StyleManager cant load CSS file with name main.css

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 7u6
    • Fix Version/s: None
    • Component/s: javafx
    • Environment:

      jdk 1.7.0_10 windows 64 bit and java fx sdk 2.2

      Description

      When i try add stylesheet with name main.css to Scene, I got following warning:

       WARNING: com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged Resource "main.css" not found.

      and style not applied.

      When renamed main.css to style.css, works fine.

      A bit of source code:

      public class MainClass extends Application {

          public static void main(String[] args) {
              Application.launch(MainClass.class, args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              BorderPane borderPane = new BorderPane();

              Scene scene = new Scene(borderPane);
              stage.setScene(scene);
              stage.show();
              scene.getStylesheets().add("main.css");
          }
      }

      If "main" is reserved word, you need made specify it in a javadoc

        Attachments

          Activity

            People

            Assignee:
            dgrieve David Grieve
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: