Wordwrap « JTextArea « Java Swing Q&A





1. Wordwrap on a JTextArea    coderanch.com

2. JTextArea Rotation & WordWrap -- Challenging issue.    coderanch.com

It's challenging to do this "right" but it's not so tough to do something quick and dirty that can break lines on its own. public class RotatedTextArea extends JTextArea { /** override paintComponent() to rotate -- works well only if square * @author Brian Cole 2005 */ public void paintComponent(Graphics g) { double angle = -Math.PI/2; double mid = Math.min(getWidth(), getHeight())/2.0; ...