Is there any way to reuse my CSS in an application that uses Java Swing ?
Java swing generally isn't built to separate its controls from its presentation, but there is an open-source framework called Jaxx that has been written that might help you. With Jaxx you can do something like this:
//your style goes here...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and then include a css file to style your components:
Application {
lookAndFeel: system;
}
#display {
background: #BCE5AD;
opaque: true;
horizontalAlignment: right;
border: {BorderFactory.createBevelBorder(BevelBorder.LOWERED)};
font-size: 22;
font-weight: bold;
}
- 热议问题