Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextArea alignment

Status
Not open for further replies.

mohansekar

Programmer
Jul 6, 2001
23
IN
Hi,

Could anyone tell how the set the alignment property of java.awt.TextArea with code please.

It's very urgent

thanx

bye
 
There is no alignment property for a TextArea. The alignment is determined by which LayoutManager you are using. Wushutwist
 
If you are refering to setting the alignment of text within the textarea, I think you will have to write your own methods or classes.

If you are referring to setting the alignment of the textarea itself, you can use null layout. Something like this:-

import java.awt.*;

public class textAreaDemo extends Frame
{
public textAreaDemo()
{
setSize(200,200);
setLayout(null);

TextArea ta = new TextArea();
ta.setBounds(new Rectangle(10,30,70,40));

TextArea ta2 = new TextArea();
ta2.setBounds(new Rectangle(60,110,90,80));

add(ta,null);
add(ta2,null);
}

public static void main(String[] args)
{
textAreaDemo tad = new textAreaDemo();
tad.show();
}
}

Regards,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top