Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.awt.Insets;

import javax.swing.JTextArea;

public class Main {
    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;
    }
}