快乐着飞舞着

---Nothing to do is doing nothing
随笔 - 93, 文章 - 5, 评论 - 56, 引用 - 0
数据加载中……

使用 skinLf 的例子

 1mport java.io.*;
 2import java.awt.*
;
 3import java.awt.event.*
;
 4import javax.swing.*
;
 5import com.l2fprod.gui.plaf.skin.*
;
 6import com.l2fprod.util.*
;
 7public class demo extends JApplet 
{
 8    
/**
 9
     * Constructor for the demo object
10     */

11    public demo() {
12    }

13    public void createUI(String[] themes) {
14        this.getContentPane().setLayout(new BorderLayout(33
));
15        this.getContentPane().add("Center"new
 demoPanel(themes));
16    }

17    public static void main(String[] args) throws Exception {
18        if (args.length > 0
{
19            String themepack = args[0
];
20            if (themepack.endsWith(".xml")) 
{
21                SkinLookAndFeel.setSkin(SkinLookAndFeel.loadThemePackDefinition(SkinUtils.toURL(new File(args[0
]))));
22            }
 else {
23                SkinLookAndFeel.setSkin(SkinLookAndFeel.loadThemePack(args[0
]));
24            }

25            SkinLookAndFeel.enable();
26        }

27        demo d = new demo();
28
        d.createUI(args);
29        JFrame f = new JFrame("Skin Look And Feel " +
 SkinLookAndFeel.VERSION);
30        f.getContentPane().setLayout(new
 BorderLayout());
31        f.getContentPane().add("Center"
, d);
32
        f.pack();
33        //WindowUtils.centerOnScreen(f);

34        f.setVisible(true);
35        f.addWindowListener(new WindowAdapter() 
{
36            public void windowClosing(WindowEvent event
{
37                System.exit(0
);
38            }

39        }
);
40    }

41}

42

http://sourceforge.net/projects/skinlf/ 

posted on 2005-07-03 18:29 快乐着飞舞着 阅读(557) 评论(0)  编辑 收藏 引用 所属分类: J2se

只有注册用户登录后才能发表评论。

Clicky