Example usage for javax.swing JTextArea getInsets

List of usage examples for javax.swing JTextArea getInsets

Introduction

In this page you can find the example usage for javax.swing JTextArea getInsets.

Prototype

@BeanProperty(expert = true)
public Insets getInsets() 

Source Link

Document

If a border has been set on this component, returns the border's insets; otherwise calls super.getInsets.

Usage

From source file:Main.java

public static int getTextableHeight(JTextArea textArea) {
    int textableHeight = textArea.getLineCount() * textArea.getFontMetrics(textArea.getFont()).getHeight();
    Insets insets = textArea.getInsets();
    if (insets != null)
        textableHeight += insets.top + insets.bottom;

    return textableHeight;
}