?? 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);
}
/**
* 設(shè)置字體顏色
* @param color 顏色值 "#FFFFFF"
*/
public void setFontColor(String color){
Element el = DOM.getChild(getElement(), 0);
DOM.setAttribute(el, "color", color);
}
/**
* 設(shè)置文本文字
* @param text "文字串"
*/
public void setText(String text) {
Element el = DOM.getChild(getElement(), 0);
DOM.setInnerText(el, text);
}
/**
* 設(shè)置字體大小
* @param size 大小值 "12pt"
*/
public void setFontSize(String size){
Element el = DOM.getChild(getElement(), 0);
DOM.setAttribute(el, "size", size);
}
/**
* 設(shè)置寬度
* @param width 寬度值
*/
public void setLalbelWidth(String width){
this.setWidth(width);
}
/**
* 設(shè)置高度
* @param h 高度值
*/
public void setLalbelHeight(String h){
this.setHeight(h);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -