Java examples for Swing:JTextArea
make Wrappable Label as JTextArea
//package com.java2s; import java.awt.Font; import javax.swing.JTextArea; public class Main { public static JTextArea makeWrappableLabel(String labelText) { JTextArea wrappedLabel = new JTextArea(labelText); wrappedLabel.setLineWrap(true);//from w w w . j av a2s. c om wrappedLabel.setWrapStyleWord(true); wrappedLabel.setFont(new Font("Tahoma", Font.PLAIN, 11)); wrappedLabel.setEditable(false); wrappedLabel.setBackground(null); return wrappedLabel; } }