Expand « JTextArea « Java Swing Q&A





1. Java swing and expand window/textarea    stackoverflow.com

In the following example, I want to be able to expand the text area when I maximize or minimize the window. Right now, the textarea is set to the cols/rows. ...

2. How to expand JTextArea as main panel is resized    coderanch.com

import javax.swing.*; import java.awt.*; class Testing extends JFrame { public Testing() { setSize(200,200); setLocation(300,200); setDefaultCloseOperation(EXIT_ON_CLOSE); JTextArea ta = new JTextArea(10,10); JScrollPane sp = new JScrollPane(ta); sp.setPreferredSize(new Dimension(175,150)); JPanel jp = new JPanel(new BorderLayout()); JPanel top = new JPanel(); top.add(new JLabel("Top")); JPanel bottom = new JPanel(); bottom.add(new JLabel("Bottom")); JPanel left = new JPanel(); left.add(new JLabel("Left")); JPanel right = new JPanel(); right.add(new JLabel("Right")); ...

3. [SOLVED] Creating an auto-expanding JTextArea    java-forums.org

Document.getLength() returns characters, so I doubt it will do what I want efficiently. Does JTextArea.getText() return the newline characters as well? (not only the ones created by pressing enter, but also the ones created because of the setLineWrap being true) That would probably help me with what I want with a bit of work, but I can't find any information on ...

4. How do you stop a JTextArea from expanding    forums.oracle.com

5. Expand/collapse part of text in JTextArea    forums.oracle.com