专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »Java教程 » 暴风影音2009换肤:简单的界面换肤术 »正文

暴风影音2009换肤:简单的界面换肤术

来源: 发布时间:星期四, 2008年12月18日 浏览:2次 评论:0
1:可以直接在下面 3个中个: import javax.swing.*; UIManager.LookAndFeel("com.sun.java.swing.plaf.mot.MotLookAndFeel") ; UIManager.LookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel") ; UIManager.LookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel") ; 2:或采用菜单来变换: import javax.swing.*; JMenuBar mb = JMenuBar; JMenu file = JMenu("Look & Feel", true); ButtonGroup buttonGroup = ButtonGroup; final UIManager.LookAndFeelInfo info = UIManager.getInstalledLookAndFeels; for ( i = 0; i < info.length; i) { JRadioButtonMenuItem item = JRadioButtonMenuItem(info[i].getName, i 0); final String Name = info[i].getClassName; item.addActionListener( ActionListener { public void actionPerformed(ActionEvent ae) { try { UIManager.LookAndFeel(Name); } catch (Exception e) { .out.prln(e); } SwingUtilities.updateComponentTreeUI(TouchyFeely.this); } }); buttonGroup.add(item); file.add(item); } mb.add(file); JMenuBar(mb); }

相关文章

读者评论

  • 共0条 分0页

发表评论

  • 昵称:
  • 内容: