本文整理汇总了Java中java.awt.peer.TextFieldPeer.getPreferredSize方法的典型用法代码示例。如果您正苦于以下问题:Java TextFieldPeer.getPreferredSize方法的具体用法?Java TextFieldPeer.getPreferredSize怎么用?Java TextFieldPeer.getPreferredSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.peer.TextFieldPeer
的用法示例。
在下文中一共展示了TextFieldPeer.getPreferredSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preferredSize
import java.awt.peer.TextFieldPeer; //导入方法依赖的package包/类
/**
* @deprecated As of JDK version 1.1,
* replaced by <code>getPreferredSize(int)</code>.
*/
@Deprecated
public Dimension preferredSize(int columns) {
synchronized (getTreeLock()) {
TextFieldPeer peer = (TextFieldPeer)this.peer;
return (peer != null) ?
peer.getPreferredSize(columns) :
super.preferredSize();
}
}
示例2: preferredSize
import java.awt.peer.TextFieldPeer; //导入方法依赖的package包/类
/**
* Returns the preferred size of a text field with the specified number
* of columns.
*
* @param columns The number of columns to get the preferred size for.
*
* @deprecated This method is deprecated in favor of
* <code>getPreferredSize(int)</code>.
*/
public Dimension preferredSize(int columns)
{
if (isPreferredSizeSet())
return new Dimension(prefSize);
TextFieldPeer peer = (TextFieldPeer) getPeer ();
if (peer == null)
return new Dimension (getWidth(), getHeight());
return peer.getPreferredSize (columns);
}
示例3: preferredSize
import java.awt.peer.TextFieldPeer; //导入方法依赖的package包/类
/**
* Returns the preferred size of a text field with the specified number
* of columns.
*
* @param columns The number of columns to get the preferred size for.
*
* @deprecated This method is deprecated in favor of
* <code>getPreferredSize(int)</code>.
*/
public Dimension preferredSize(int columns)
{
if (isPreferredSizeSet())
return new Dimension(prefSize);
TextFieldPeer peer = (TextFieldPeer) getPeer ();
if (peer == null)
return new Dimension (getWidth(), getHeight());
return peer.getPreferredSize (columns);
}
示例4: preferredSize
import java.awt.peer.TextFieldPeer; //导入方法依赖的package包/类
/**
* Returns the preferred size for this text field
* with the specified number of columns.
*
* @param columns the number of columns
* @return the preferred size for the text field
*
* @deprecated As of JDK version 1.1,
* replaced by {@code getPreferredSize(int)}.
*/
@Deprecated
public Dimension preferredSize(int columns) {
synchronized (getTreeLock()) {
TextFieldPeer peer = (TextFieldPeer)this.peer;
return (peer != null) ?
peer.getPreferredSize(columns) :
super.preferredSize();
}
}