本文整理了Java中javax.swing.JTextArea.getPreferredSize()
方法的一些代码示例,展示了JTextArea.getPreferredSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextArea.getPreferredSize()
方法的具体详情如下:
包路径:javax.swing.JTextArea
类名称:JTextArea
方法名:getPreferredSize
暂无
代码示例来源:origin: pentaho/mondrian
jScrollPaneCDATA.setMaximumSize(cdataTextArea.getPreferredSize());
代码示例来源:origin: pentaho/mondrian
jScrollPaneCDATA.setMaximumSize(cdataTextArea.getPreferredSize());
代码示例来源:origin: igniterealtime/Spark
public Dimension getPreferredSize() {
final Dimension size = super.getPreferredSize();
size.width = 0;
return size;
}
}
代码示例来源:origin: com.numdata/numdata-swing
@Override
public Dimension getPreferredSize()
{
final Dimension result = super.getPreferredSize();
if ( result.width > preferredWidth )
{
result.width = preferredWidth;
}
return result;
}
};
代码示例来源:origin: chatty/chatty
@Override
public Dimension getPreferredSize() {
Dimension d = super.getPreferredSize();
System.out.println(d);
return d;
}
代码示例来源:origin: stackoverflow.com
JTextArea textArea = new JTextArea();
textArea.setLineWrap( true );
textArea.setWrapStyleWord( true );
textArea.setText("one two three four five six seven eight nine ten");
System.out.println("000: " + textArea.getPreferredSize());
textArea.setSize(100, 1);
System.out.println("100: " + textArea.getPreferredSize());
textArea.setSize( textArea.getPreferredSize() );
代码示例来源:origin: org.netbeans.api/org-netbeans-spi-quicksearch
@Override
public Dimension getPreferredSize() {
if (prefWidth == null) {
Dimension orig = super.getPreferredSize();
prefWidth = new Dimension(computePrefWidth(), orig.height);
}
return prefWidth;
}
代码示例来源:origin: org.boofcv/demonstrations
private JTextArea createTextInfo() {
JTextArea comp = new JTextArea(1,6);
comp.setMaximumSize(comp.getPreferredSize());
comp.setEditable(false);
return comp;
}
代码示例来源:origin: org.boofcv/demonstrations
private JTextArea createTextInfo() {
JTextArea comp = new JTextArea(1,6);
comp.setMaximumSize(comp.getPreferredSize());
comp.setEditable(false);
return comp;
}
代码示例来源:origin: sarahtattersall/PIPE
/**
* Set the text for the annotation
* @param text of the annotation
*/
public void setText(String text) {
noteText.setText(text);
noteText.setSize(noteText.getPreferredSize());
}
代码示例来源:origin: raydac/netbeans-mmd-plugin
@Override
public void changedUpdate(@Nonnull final DocumentEvent e) {
updateEditorPanelSize(textEditor.getPreferredSize());
}
});
代码示例来源:origin: org.boofcv/demonstrations
private JTextArea createTextInfo() {
JTextArea comp = new JTextArea(1,6);
comp.setMaximumSize(comp.getPreferredSize());
comp.setEditable(false);
return comp;
}
代码示例来源:origin: org.boofcv/demonstrations
private JTextArea createTextInfo() {
JTextArea comp = new JTextArea(1,6);
comp.setMaximumSize(comp.getPreferredSize());
comp.setEditable(false);
return comp;
}
}
代码示例来源:origin: org.boofcv/demonstrations
private JTextArea createErrorComponent() {
JTextArea comp = new JTextArea(1,6);
comp.setMaximumSize(comp.getPreferredSize());
comp.setEditable(false);
return comp;
}
代码示例来源:origin: org.boofcv/visualize
private JTextArea createErrorComponent() {
JTextArea comp = new JTextArea(1,6);
comp.setMaximumSize(comp.getPreferredSize());
comp.setEditable(false);
return comp;
}
代码示例来源:origin: org.boofcv/boofcv-swing
JTextArea createErrorComponent(int numRows) {
JTextArea comp = new JTextArea(numRows,6);
comp.setMaximumSize(comp.getPreferredSize());
comp.setEditable(false);
comp.setBorder(BorderFactory.createEmptyBorder(0,0,4,0));
return comp;
}
代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui
/**
* @see org.apache.airavata.xbaya.ui.graph.NodeGUI#isIn(java.awt.Point)
*/
@Override
protected boolean isIn(Point point) {
Point position = this.node.getPosition();
Dimension preferredSize = this.textArea.getPreferredSize();
Rectangle area = new Rectangle(position, preferredSize);
return area.contains(point);
}
代码示例来源:origin: us.ihmc/ImageProcessing
private JTextArea createTextInfo() {
JTextArea comp = new JTextArea(1,6);
comp.setMaximumSize(comp.getPreferredSize());
comp.setEditable(false);
return comp;
}
代码示例来源:origin: org.boofcv/demonstrations
private JTextArea createTextComponent() {
JTextArea comp = new JTextArea(1,6);
comp.setMaximumSize(comp.getPreferredSize());
comp.setEditable(false);
return comp;
}
代码示例来源:origin: sarahtattersall/PIPE
/**
* Adjust the bottom vertical of the annotation
* @param dy y offset
*/
public void adjustBottom(int dy) {
if (noteText.getPreferredSize().height <= noteText.getHeight() + dy) {
noteText.setSize(new Dimension(noteText.getWidth(), noteText.getHeight() + dy));
}
}
内容来源于网络,如有侵权,请联系作者删除!