Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.awt.Font;

import javax.swing.JTextArea;
import javax.swing.UIManager;

public class Main {
    /**
     * Configures a text area to display as if it were a label.  This can be useful if you know how many columns
     * you want a label to be.
     * @param textArea The text area to configure as a JLabel.
     */
    public static void configureAsLabel(JTextArea textArea) {
        textArea.setOpaque(false);
        Font textFont = UIManager.getFont("Label.font");
        textArea.setFont(textFont);
        textArea.setBorder(null);
        textArea.setLineWrap(true);
        textArea.setWrapStyleWord(true);
        textArea.setEditable(false);
    }
}