• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

JTextField - change caret side

Im trying to change a JTextField so it writes from right to left, much the same way a spreadsheet or calculator cell works for numerical values. How would I do this?

thanks.
0
illucid
Asked:
illucid
  • 2
1 Solution
 
jimmackCommented:
JTextField rightAlignedTextField = new JTextField(20);

rightAlignedTextField.setHorizontalAlignment(SwingConstants.RIGHT);
0
 
jimmackCommented:
;-)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now