Eko
Eko

Reputation: 1557

Center text in TextArea

Is there a way to horizontally align a text in a textarea from awt? There is a getAlignment method but not a setAlignment. And I just want to use awt, not swing

Upvotes: 0

Views: 5395

Answers (2)

javawocky
javawocky

Reputation: 919

You should try putting your components(eg TextArea) into containers it makes laying them out a much less stressfull task.

Take a look here: http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html

GridLayout or BorderLayout may be ones you should take a look at in particular. Best of luck!

Upvotes: 0

Arjit
Arjit

Reputation: 3456

There is no alignment property for a TextArea. The alignment is determined by which LayoutManager you are using.

Upvotes: 2

Related Questions