Java JTextArea makeLabelStyle(JTextArea textArea)

Here you can find the source of makeLabelStyle(JTextArea textArea)

Description

Make a JTextArea to look like a JLabel

License

Open Source License

Parameter

Parameter Description
textArea the text area to modify

Return

the same text area

Declaration

public static JTextArea makeLabelStyle(JTextArea textArea) 

Method Source Code

//package com.java2s;

import javax.swing.*;

public class Main {
    /**//from  w  w w  . j a va2  s .  c o m
     * Make a JTextArea to look like a JLabel
     * 
     * @param textArea the text area to modify
     * @return the same text area
     */
    public static JTextArea makeLabelStyle(JTextArea textArea) {

        // From: http://www.coderanch.com/t/338648/GUI/java/Multiple-lines-JLabel

        if (textArea == null)
            return null;

        textArea.setEditable(false);
        textArea.setCursor(null);
        textArea.setOpaque(false);
        textArea.setFocusable(false);

        return textArea;
    }
}

Related

  1. getAreaValue(JTextArea ta)
  2. getTextAreaScrollPaneContainer(JTextArea textArea, int nbLines)
  3. getTextDimension(JTextArea textArea, Dimension maxDimension)
  4. initLogConsole(final JTextArea textArea)
  5. initTextAreaEdit(JTextArea j1)
  6. makeTabMoveFocus(JTextArea textArea)
  7. out(final JTextArea ta)
  8. preventInputingNewLineOnTextArea(JTextArea txe, AbstractAction actionOnEnter)
  9. printExceptionInfo(Exception e, JTextArea console)