當前位置:首頁 » 編程語言 » java設置字體顏色

java設置字體顏色

發布時間: 2023-01-24 05:48:37

java中怎麼改變字體顏色

字體大小及顏色
a:Java代碼區域的字體大小和顏色:
window -- Preferences -- General -- Appearance -- Colors And Fonts -- Java修改 -- Java Edit Text Font
b:控制台
window -- Preferences -- General -- Appearance -- Colors And Fonts -- Debug -- Console font
c:其他文件
window -- Preferences -- General -- Appearance -- Colors And Fonts -- Basic -- Text Font

㈡ java中如何讓字體變色

簡單設置如下:
jlabel.setFont(new java.awt.Font("Dialog", 1, 15));
「dialog」代表字體,1代表樣式(1是粗體,0是平常的)15是字型大小
//設置字體
jlabel.setForeground(Color.red);
//設置顏色

㈢ 請問java中怎樣設置字體的顏色

下拉框和textfield,textarea這些控制項都有setforeground方法,這個函數是設置前景色的,設置為紅色就行了.
例如:textfield
txt=new
textfield("請輸入姓名");
txt.setforeground(color.red);

熱點內容
sql資料庫項目 發布:2025-07-20 14:06:11 瀏覽:162
linux查看selinux狀態 發布:2025-07-20 13:36:35 瀏覽:914
福利資源解壓密碼 發布:2025-07-20 13:34:10 瀏覽:269
我的世界怎麼在手機搞伺服器 發布:2025-07-20 13:26:07 瀏覽:906
android系統鍵盤 發布:2025-07-20 13:19:38 瀏覽:500
程序化交易演算法 發布:2025-07-20 13:09:58 瀏覽:973
已關閉伺服器是什麼意思 發布:2025-07-20 13:06:49 瀏覽:709
三星s5密碼多少錢 發布:2025-07-20 12:55:14 瀏覽:961
密碼忘記了怎麼找回 發布:2025-07-20 12:46:18 瀏覽:534
華為的密碼鎖為什麼開不了 發布:2025-07-20 12:45:35 瀏覽:133