网站建设资讯

NEWS

网站建设资讯

java设置字体颜色代码 java font字体颜色

java记事本设置字体颜色

java设置字体颜色

成都创新互联公司主要从事成都网站建设、成都网站设计、网页设计、企业做网站、公司建网站等业务。立足成都服务西秀,10多年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:18982081108

1.

打开Eclipse或者Myeclipse,选择windows(系统)选项;

2.

点击preferences(首选项);

3.

弹出首选项的窗口,点击Appearance(外观);

4.

点击color and font (颜色和字体)

java中怎么设置label的字体大小及颜色显示

Java设置label字体代码如下:

ublic class SetColor extends JFrame{

JLabel jlabel = new JLabel("颜色,大小");

public SetColor(){

this.setLayout(null);

jlabel.setBounds(0, 0, 200, 40);

jlabel.setFont(new Font("",1,30));//设置字体大小

jlabel.setForeground(Color.BLUE);//设置字体颜色

this.add(jlabel);

this.setSize(200,200);

this.setVisible(true);

}

/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

SetColor sc = new SetColor();

}}

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中如何设置按钮文字的大小、颜色和字体?

submit= new JButton("登陆");

submit.setFont(new Font("宋体", Font.PLAIN, 16));

三个参数分别表示: 字体,样式(粗体,斜体等),字号

submit.setForeground(Color.RED);

这个表示给组件上的文字设置颜色Color.RED表示红色

当然你也可以自己给RGB的值 比如 submit.setForeground(new Color(215,215,200));

JLabel组件支持HTML标记代码

infoLab= new JLabel("htmla href='地址'用户登陆系统/a/html", JLabel.CENTER);

*注意:地址要单引号引起来。这个表示给用户登录系统几个字增加超链接

infoLab .setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

这个表示给这个文字添加鼠标样式,当鼠标移动到文字上,鼠标变成手型


新闻标题:java设置字体颜色代码 java font字体颜色
URL标题:http://cdweb.net/article/dosphic.html