javax.swing.JTextArea.getMinimumSize()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(195)

本文整理了Java中javax.swing.JTextArea.getMinimumSize()方法的一些代码示例,展示了JTextArea.getMinimumSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextArea.getMinimumSize()方法的具体详情如下:
包路径:javax.swing.JTextArea
类名称:JTextArea
方法名:getMinimumSize

JTextArea.getMinimumSize介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

area.getMinimumSize().height));

代码示例来源:origin: sarahtattersall/PIPE

/**
 * Calculates the BoundsOffsets used for setBounds() method
 *
 * Implemented because the canvas has no layout manager
 *
 */
public void updateBounds() {
  int newHeight = noteText.getPreferredSize().height;
  if (noteText.getHeight() < newHeight && newHeight >= noteText.getMinimumSize().height) {
    noteText.setSize(noteText.getWidth(), newHeight);
  }
  int rectWidth = noteText.getWidth() + GUIConstants.RESERVED_BORDER;
  int rectHeight = noteText.getHeight() + GUIConstants.RESERVED_BORDER;
  noteRect.setFrame(GUIConstants.RESERVED_BORDER / 2, GUIConstants.RESERVED_BORDER / 2, rectWidth, rectHeight);
  setSize(rectWidth + GUIConstants.ANNOTATION_SIZE_OFFSET, rectHeight + GUIConstants.ANNOTATION_SIZE_OFFSET);
  noteText.setLocation((int) noteRect.getX() + (rectWidth - noteText.getWidth()) / 2,
      (int) noteRect.getY() + (rectHeight - noteText.getHeight()) / 2);
  bounds.setBounds(model.getX() - 20, model.getY() - 20,
      rectWidth + GUIConstants.RESERVED_BORDER + GUIConstants.ANNOTATION_SIZE_OFFSET + 20,
      rectHeight + GUIConstants.RESERVED_BORDER + GUIConstants.ANNOTATION_SIZE_OFFSET + 20);
  setBounds(bounds);
}

相关文章

JTextArea类方法