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);
熱點內容