简体   繁体   中英

Java Swing GUI theming

Is it possible to develop custom PLAF themes for Swing? I would appreciate constructive suggestions in this topic Thanks

Yes! But don't do that. If you need just change colors. Try JGoodies or Substance and obey writing your own PLAF.

It depends on what you exactly want to do. Writing you own LAF extending from Java Basic or Metal it is a lot of work, but it can be done. If you have some special aims such eg painting a gradient background for Jtrees or highlightin animation it will get tricky, but this can also be done. It is also very helpful to download open source LAFs for swing and have a look at the source code, to learn how to write your own PLAF. Please have a look here .

Infonode provides a framework for developing new look and feels. They have a GPL'd library which you can use.

See this .

Sun 为创建自定义PLAF提供了一个有趣的介绍

If you want to customise the Swing Look and Feel - look beyond the PLAF to libraries like FUSE. This is next-gen swing look and feel customisation.

Here are some screenshots: http://www.curious-creature.org/2006/02/12/fuseswing-demo/

Here is the library: https://fuse.dev.java.net/

This is something written that has used it: https://aerith.dev.java.net/ (Also with some great screenshots)

It is possible to create a custom PLAF using the built-in Synth Look-and-Feel. It's basically a PLAF that allows you to customize the appearance of all components (or just specific ones via component naming) via an XML configuration file. The [javax.swing.plaf.synth][1] package JavaDoc gives a good overview of what's possible, and there is additional documentation linked to in the JavaDocs for using this PLAF.

I've used this in my own projects before and it's very easy to work with. You can use your own custom graphic images for all components, and can customize pretty much anything you want without having to go through all that cumbersome custom coding that used to be necessary to make a PLAF

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM