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

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

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

JTextArea.getColumns介绍

暂无

代码示例

代码示例来源:origin: Waikato/meka

/**
 * Returns the columns.
 *
 * @return        the columns
 */
public int getColumns() {
  return m_TextCode.getColumns();
}

代码示例来源:origin: net.sf.meka/meka

/**
 * Returns the columns.
 *
 * @return        the columns
 */
public int getColumns() {
  return m_TextCode.getColumns();
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
 * Overrides {@link #getPromptComponent(JTextComponent)} to additionally
 * update {@link JTextArea} specific properties.
 */
@Override
public JTextComponent getPromptComponent(JTextComponent txt) {
  JTextArea lbl = (JTextArea) super.getPromptComponent(txt);
  JTextArea txtArea = (JTextArea) txt;
  lbl.setColumns(txtArea.getColumns());
  lbl.setRows(txtArea.getRows());
  return lbl;
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
 * Overrides {@link #getPromptComponent(JTextComponent)} to additionally
 * update {@link JTextArea} specific properties.
 */
@Override
public JTextComponent getPromptComponent(JTextComponent txt) {
  JTextArea lbl = (JTextArea) super.getPromptComponent(txt);
  JTextArea txtArea = (JTextArea) txt;
  lbl.setColumns(txtArea.getColumns());
  lbl.setRows(txtArea.getRows());
  return lbl;
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * Overrides {@link #getPromptComponent(JTextComponent)} to additionally
 * update {@link JTextArea} specific properties.
 */
@Override
public JTextComponent getPromptComponent(JTextComponent txt) {
  JTextArea lbl = (JTextArea) super.getPromptComponent(txt);
  JTextArea txtArea = (JTextArea) txt;
  lbl.setColumns(txtArea.getColumns());
  lbl.setRows(txtArea.getRows());
  return lbl;
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

/**
 * Overrides {@link #getPromptComponent(JTextComponent)} to additionally
 * update {@link JTextArea} specific properties.
 */
@Override
public JTextComponent getPromptComponent(JTextComponent txt) {
  JTextArea lbl = (JTextArea) super.getPromptComponent(txt);
  JTextArea txtArea = (JTextArea) txt;
  lbl.setColumns(txtArea.getColumns());
  lbl.setRows(txtArea.getRows());
  return lbl;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-designer

private static Dimension computeSizeForTextComponent(JTextComponent textComponent) {
  if (textComponent instanceof JTextField) {
    JTextField textField = (JTextField)textComponent;
    int columns = textField.getColumns();
    if (columns > 0) {
      return computeSizeForTextComponentColumns(textComponent, columns);
    }
  } else if (textComponent instanceof JTextArea) {
    JTextArea textArea = (JTextArea)textComponent;
    int columns = textArea.getColumns();
    if (columns > 0) {
      return computeSizeForTextComponentColumns(textComponent, columns);
    }
  }
  return textComponent.getPreferredSize();
}

代码示例来源:origin: triplea-game/triplea

@Test
public void columns() {
 final JTextArea area = JTextAreaBuilder.builder()
   .columns(20)
   .build();
 assertThat(area.getColumns(), is(20));
}

代码示例来源:origin: pentaho/pentaho-reporting

@Before
public void setUp() {
 ParameterDefinitionEntry entry = mock( ParameterDefinitionEntry.class );
 ParameterContext parameterContext = mock( ParameterContext.class );
 updateContext = mock( ParameterUpdateContext.class );
 ResourceBundleFactory resourceBundleFactory = mock( ResourceBundleFactory.class );
 Locale locale = new Locale( "test_test" );
 doReturn( ENTRY_NAME ).when( entry ).getName();
 doReturn( Number.class ).when( entry ).getValueType();
 doReturn( "#,###,##0.00" ).when( entry ).getParameterAttribute( ParameterAttributeNames.Core.NAMESPACE,
  ParameterAttributeNames.Core.DATA_FORMAT, parameterContext );
 doReturn( "#,###,##0.00" ).when( entry ).getTranslatedParameterAttribute( ParameterAttributeNames.Core.NAMESPACE,
  ParameterAttributeNames.Core.DATA_FORMAT, parameterContext );
 doReturn( "utc" ).when( entry ).getParameterAttribute( ParameterAttributeNames.Core.NAMESPACE,
  ParameterAttributeNames.Core.TIMEZONE, parameterContext );
 doReturn( resourceBundleFactory ).when( parameterContext ).getResourceBundleFactory();
 doReturn( locale ).when( resourceBundleFactory ).getLocale();
 doReturn( TimeZone.getDefault() ).when( resourceBundleFactory ).getTimeZone();
 comp = new TextAreaParameterComponent( entry, parameterContext, updateContext );
 verify( updateContext ).addChangeListener( any( ChangeListener.class ) );
 JTextArea textArea = findTextArea( comp );
 assertThat( textArea, is( notNullValue() ) );
 assertThat( textArea.getColumns(), is( equalTo( 60 ) ) );
 assertThat( textArea.getRows(), is( equalTo( 10 ) ) );
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-designer

JTextArea renderedTextArea = (JTextArea)((JScrollPane)component).getViewport().getView();
JTextArea inlineTextArea = FormComponentBox.createTextArea(renderedTextArea.getText(), renderedTextArea.getRows(), renderedTextArea.getColumns());
JScrollPane inlineScrollPane = new JScrollPane(inlineTextArea, renderedScrollPane.getVerticalScrollBarPolicy(), renderedScrollPane.getHorizontalScrollBarPolicy());
Font font = UIManager.getFont("TextArea.font"); // NOI18N

相关文章

JTextArea类方法