溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Java swing幾種常用的樣式設置

發(fā)布時間:2020-08-05 22:47:31 來源:網絡 閱讀:866 作者:best_grx 欄目:軟件技術
// Metal風格 (默認)
        String lookAndFeel = "javax.swing.plaf.metal.MetalLookAndFeel";
        UIManager.setLookAndFee(lookAndFeel);
// Windows風格
        String lookAndFeel = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
        UIManager.setLookAndFee(lookAndFeel);  

// Windows Classic風格
        String lookAndFeel = "com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel";
        UIManager.setLookAndFee(lookAndFeel);  

// Motif風格
        String lookAndFeel = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
        UIManager.setLookAndFeel(lookAndFeel);

// Mac風格 (需要在相關的操作系統(tǒng)上方可實現)
        String lookAndFeel = "com.sun.java.swing.plaf.mac.MacLookAndFeel";
        UIManager.setLookAndFeel(lookAndFeel);

// GTK風格 (需要在相關的操作系統(tǒng)上方可實現)
        String lookAndFeel = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
        UIManager.setLookAndFeel(lookAndFeel);

// 可跨平臺的默認風格
        String lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
        UIManager.setLookAndFeel(lookAndFeel);

// 當前系統(tǒng)的風格
        String lookAndFeel = UIManager.getSystemLookAndFeelClassName();
        UIManager.setLookAndFeel(lookAndFeel);
向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI