zoukankan      html  css  js  c++  java
  • UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

    这是设置图形界面外观的.java的图形界面外观有3种,默认是java的金属外观,还有就是windows系统,motif系统外观.
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    这是把外观设置成你所使用的平台的外观,也就是你这个程序在哪个平台运行,显示的窗口,对话框外观将是哪个平台的外观.

    程序中添加代码“UIManager.setLookAndFeel(lookAndFeel);”即可,

    JDK自带的有如下几个:
    1、Metal风格 (默认)
    String lookAndFeel = "javax.swing.plaf.metal.MetalLookAndFeel";
    UIManager.setLookAndFeel(lookAndFeel);
    2、Windows风格
    String lookAndFeel = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
    UIManager.setLookAndFeel(lookAndFeel);
    3、Windows Classic风格
    String lookAndFeel = "com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel";
    UIManager.setLookAndFeel(lookAndFeel);
    4、Motif风格
    String lookAndFeel = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
    UIManager.setLookAndFeel(lookAndFeel);
    5、Mac风格 (需要在相关的操作系统上方可实现)
    String lookAndFeel = "com.sun.java.swing.plaf.mac.MacLookAndFeel";
    UIManager.setLookAndFeel(lookAndFeel);
    6、GTK风格 (需要在相关的操作系统上方可实现)
    String lookAndFeel = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
    UIManager.setLookAndFeel(lookAndFeel);
    7、可跨平台的默认风格
    String lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
    UIManager.setLookAndFeel(lookAndFeel);
    8、当前系统的风格
    String lookAndFeel = UIManager.getSystemLookAndFeelClassName();
    UIManager.setLookAndFeel(lookAndFeel);
  • 相关阅读:
    centos 7 install
    sbt
    maven create project
    java异常个人理解
    (poj1094)Sorting It All Out
    stars
    Following Orders(拓扑排序)
    The House Of Santa Claus(dfs)
    Prime Path(bfs)
    Fence Repair(优先队列容器的应用)
  • 原文地址:https://www.cnblogs.com/new-comer/p/5056315.html
Copyright © 2011-2022 走看看