2

I have been doing some GUIs in Java. I know in other languages (like Python) you can create a CSS style sheet and load it into the program(pretty simple). But with Swing I have had to manually code the style for each individual component, which is tedious and hard to manage.

Is there a way, in Swing, that I can load an external style sheet, and use those styles for my components across my whole program?

I have already looked into "Look and Feel" as an option, but decided to go with CSS.

user2444217
  • 581
  • 2
  • 7
  • 16

2 Answers2

3

Swing will be deprecated and replaced by JavaFX in the long run. If you are building a new application, why don't you look into skinning JavaFX with CSS?

Tilo
  • 3,255
  • 26
  • 31
1

The best way I know is java-universal-css-engine, but I don't know if it's maintained anymore, because the last commit was on Mar 25, 2012.

So, regarding to this question, have a look at JAXX

Community
  • 1
  • 1
Martin Seeler
  • 6,874
  • 3
  • 33
  • 45