Java JTextArea estimatedRows(JTextArea text)

Here you can find the source of estimatedRows(JTextArea text)

Description

estimated Rows

License

Open Source License

Declaration

static int estimatedRows(JTextArea text) 

Method Source Code


//package com.java2s;
import javax.swing.JTextArea;

public class Main {
    static int estimatedRows(JTextArea text) {
        return (int) (((text.getText().length() / (text.getColumns() > 0 ? text.getColumns() : 80)) + 1
                + text.getText().replaceAll("[^\\n]+", "").length()) / 2);
    }//w w  w.  j  a va 2  s.c  o m
}

Related

  1. columns(JTextArea testString)
  2. commentSQL(JTextArea scriptPanel, String commentCharacter)
  3. copyFontAndMargins(final JTextArea target, final JComponent source)
  4. createTabArea(JTextArea area, int width)
  5. display(JTextArea txtOutput, String text)
  6. fixTabKeys(JTextArea textArea)
  7. getAreaValue(JTextArea ta)
  8. getTextAreaScrollPaneContainer(JTextArea textArea, int nbLines)
  9. getTextDimension(JTextArea textArea, Dimension maxDimension)