下面列出了怎么用java.awt.peer.LabelPeer的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* {@code text} is {@code null}, it is
* treated for display purposes like an empty
* string {@code ""}.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* {@code text} is {@code null}, it is
* treated for display purposes like an empty
* string {@code ""}.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
/**
* Sets the text for this label to the specified text.
* @param text the text that this label displays. If
* <code>text</code> is <code>null</code>, it is
* treated for display purposes like an empty
* string <code>""</code>.
* @see java.awt.Label#getText
*/
public void setText(String text) {
boolean testvalid = false;
synchronized (this) {
if (text != this.text && (this.text == null ||
!this.text.equals(text))) {
this.text = text;
LabelPeer peer = (LabelPeer)this.peer;
if (peer != null) {
peer.setText(text);
}
testvalid = true;
}
}
// This could change the preferred size of the Component.
if (testvalid) {
invalidateIfValid();
}
}
void test() {
setAlignment(getAlignment());
((LabelPeer) getPeer()).setAlignment(getAlignment());
setText("");
setText(null);
setText(getText());
((LabelPeer) getPeer()).setText("");
((LabelPeer) getPeer()).setText(null);
((LabelPeer) getPeer()).setText(getText());
setFont(null);
setFont(getFont());
getPeer().setFont(getFont());
setBackground(null);
setBackground(getBackground());
getPeer().setBackground(getBackground());
setForeground(null);
setForeground(getForeground());
getPeer().setForeground(getForeground());
setEnabled(isEnabled());
getPeer().setEnabled(isEnabled());
}