本文整理汇总了Java中java.awt.peer.TextComponentPeer.setEditable方法的典型用法代码示例。如果您正苦于以下问题:Java TextComponentPeer.setEditable方法的具体用法?Java TextComponentPeer.setEditable怎么用?Java TextComponentPeer.setEditable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.peer.TextComponentPeer
的用法示例。
在下文中一共展示了TextComponentPeer.setEditable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setEditable
import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
* Sets whether or not this component's text can be edited.
*
* @param editable <code>true</code> to enable editing of the text,
* <code>false</code> to disable it.
*/
public synchronized void setEditable(boolean editable)
{
this.editable = editable;
TextComponentPeer tcp = (TextComponentPeer) getPeer();
if (tcp != null)
tcp.setEditable(editable);
}
示例2: setEditable
import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
* Sets the flag that determines whether or not this
* text component is editable.
* <p>
* If the flag is set to <code>true</code>, this text component
* becomes user editable. If the flag is set to <code>false</code>,
* the user cannot change the text of this text component.
* By default, non-editable text components have a background color
* of SystemColor.control. This default can be overridden by
* calling setBackground.
*
* @param b a flag indicating whether this text component
* is user editable.
* @see java.awt.TextComponent#isEditable
* @since JDK1.0
*/
public synchronized void setEditable(boolean b) {
if (editable == b) {
return;
}
editable = b;
TextComponentPeer peer = (TextComponentPeer)this.peer;
if (peer != null) {
peer.setEditable(b);
}
}
示例3: setEditable
import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
* Sets the flag that determines whether or not this
* text component is editable.
* <p>
* If the flag is set to {@code true}, this text component
* becomes user editable. If the flag is set to {@code false},
* the user cannot change the text of this text component.
* By default, non-editable text components have a background color
* of SystemColor.control. This default can be overridden by
* calling setBackground.
*
* @param b a flag indicating whether this text component
* is user editable.
* @see java.awt.TextComponent#isEditable
* @since 1.0
*/
public synchronized void setEditable(boolean b) {
if (editable == b) {
return;
}
editable = b;
TextComponentPeer peer = (TextComponentPeer)this.peer;
if (peer != null) {
peer.setEditable(b);
}
}
示例4: setEditable
import java.awt.peer.TextComponentPeer; //导入方法依赖的package包/类
/**
* Sets the flag that determines whether or not this
* text component is editable.
* <p>
* If the flag is set to <code>true</code>, this text component
* becomes user editable. If the flag is set to <code>false</code>,
* the user cannot change the text of this text component.
* By default, non-editable text components have a background color
* of SystemColor.control. This default can be overridden by
* calling setBackground.
*
* @param b a flag indicating whether this text component
* is user editable.
* @see java.awt.TextComponent#isEditable
* @since JDK1.0
*/
public synchronized void setEditable(boolean b) {
if (editable == b) {
return;
}
editable = b;
TextComponentPeer peer = (TextComponentPeer)this.peer;
if (peer != null) {
peer.setEditable(b);
}
}