1。首先要继承substance 中的skin, 加入自己的watermark.
class MySkin extends org.pushingpixels.substance.api.skin.BusinessBlackSteelSkin{
public MySkin(){
super();
SubstanceImageWatermark imageWatermark = new SubstanceImageWatermark(this.getClass().getResourceAsStream("/ICON-INF/watermark.jpg"));
imageWatermark.setOpacity(0.7f);
imageWatermark.setKind(ImageWatermarkKind.APP_ANCHOR);
this.watermark = imageWatermark;
}
}
2.然后给要水印效果的组件的设置属性。
mainFrame.getRootPane().putClientProperty(SubstanceLookAndFeel.WATERMARK_VISIBLE, true);
3.最后就是设置皮肤了。
SubstanceLookAndFeel.setSkin(new MySkin);
|
|