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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Size/Justificaton

Status
Not open for further replies.

Eytch

Programmer
Jan 29, 2003
60
0
0
US
I would like to set all data in a field right-justified. Is there a way of defining the field size in Java or right-justify the data in the fields of a report?

Thanks,
Tripoli
 
if you mean JTextField
JTextField jUser = new JTextField("default user
",20);
you have set the length to 20
jUser.getHorizontalAlignment(JTextField.RIGHT);
set the alignment to right
other settings are:
JTextField.LEFT
JTextField.CENTER
JTextField.RIGHT
JTextField.LEADING
JTextField.TRAILING
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top