livelaughlove
livelaughlove

Reputation: 386

How to change the size of TextPane?

hi i'm working with java gui atm. Playing around with textPane and textArea. I know how to change the size of a textArea, but how do i change the size of a textPane? I've been trying to look up ways to do it, but it seems like most the topics are on changing font size nothing really on the pane size itself.....so is there a way to change the size of a textPane? if so how?

Upvotes: 1

Views: 182

Answers (1)

aioobe
aioobe

Reputation: 420951

The size of the component is controlled by the layout manager.

  1. Set a proper LayoutManager for the Container containing the JTextPane.
  2. Optional: Set proper constraints for the JTextPane
  3. Let AWT/Swing lay out and resize the component accordingly.

Further reading:

Upvotes: 2

Related Questions