CSS Styling with Swing

Can I use CSS for Java Swing?

http://code.google.com/p/flying-saucer/
Flying Saucer takes XML or XHTML and applies CSS 2.1-compliant stylesheets to it, in order to render to PDF (via iText), images, and on-screen using Swing or SWT

Swing style with CSS

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?

Apply HTML and CSS style to Java Swing component

I have to write a multi-line text inside the header cells of a JTable.

Keep the HTML simple:

setHeaderValue("<html>Line1<br>line2<br> </html>");

The above will allow for 3 lines of text (for all columns of the header).

Note: the height of the header is determined by the height of the renderer in the first column.



Related Topics



Leave a reply



Submit