展开全部
String windows="com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
UIManager.setLookAndFeel(windows);
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");//Nimbus风格,新出来的外观,jdk6 update10版本以后的才会出现
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());//当前系统风格
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");//Motif风格,外观接近windows经典,但宽宽大大,而且不是黑灰主色,而是蓝黑
//UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());//跨平台的Java界面风格,不太明白这种说法
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");//windows风格
//UIManager.setLookAndFeel("javax.swing.plaf.windows.WindowsLookAndFeel");//windows风格
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");//java风格
//UIManager.setLookAndFeel("com.apple.mrj.swing.MacLookAndFeel");
UIManager.setLookAndFeel(windows);
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");//Nimbus风格,新出来的外观,jdk6 update10版本以后的才会出现
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());//当前系统风格
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");//Motif风格,外观接近windows经典,但宽宽大大,而且不是黑灰主色,而是蓝黑
//UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());//跨平台的Java界面风格,不太明白这种说法
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");//windows风格
//UIManager.setLookAndFeel("javax.swing.plaf.windows.WindowsLookAndFeel");//windows风格
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");//java风格
//UIManager.setLookAndFeel("com.apple.mrj.swing.MacLookAndFeel");
展开全部
public class MainClass extends JFrame {
JFrame.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(new SubstanceModerateLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
MainClass main = new MainClass();
main.setsize(300, 300);
main.setvisible(true);
}
需要导入substance.jar包, SubstanceModerateLookAndFeel()为其中的一个风格
JFrame.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(new SubstanceModerateLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
MainClass main = new MainClass();
main.setsize(300, 300);
main.setvisible(true);
}
需要导入substance.jar包, SubstanceModerateLookAndFeel()为其中的一个风格
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
javaSwing控件全部是绘制的,不但耗内存,并且跟操作系统不搭配,建议使用swt,其使用jni直接调用操作系统控件资源,比如eclipse就是swt编写的,很好看,尤其是windos7.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询