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?
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.