📄 tlabel.java
字号:
package com.mc.tables.client;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Label;
public class TLabel extends Label {
public TLabel(String Text){
super();
Element e = DOM.createElement("font");
DOM.setInnerText(e, Text);
DOM.appendChild(getElement(), e);
}
/**
* 设置字体颜色
* @param color 颜色值 "#FFFFFF"
*/
public void setFontColor(String color){
Element el = DOM.getChild(getElement(), 0);
DOM.setAttribute(el, "color", color);
}
/**
* 设置文本文字
* @param text "文字串"
*/
public void setText(String text) {
Element el = DOM.getChild(getElement(), 0);
DOM.setInnerText(el, text);
}
/**
* 设置字体大小
* @param size 大小值 "12pt"
*/
public void setFontSize(String size){
Element el = DOM.getChild(getElement(), 0);
DOM.setAttribute(el, "size", size);
}
/**
* 设置宽度
* @param width 宽度值
*/
public void setLalbelWidth(String width){
this.setWidth(width);
}
/**
* 设置高度
* @param h 高度值
*/
public void setLalbelHeight(String h){
this.setHeight(h);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -