Solved

JTextField - change caret side

Posted on 2003-12-06
2
250 Views
Last Modified: 2012-06-21
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
Comment
Question by:illucid
  • 2
2 Comments
 
LVL 15

Accepted Solution

by:
jimmack earned 125 total points
ID: 9891631
JTextField rightAlignedTextField = new JTextField(20);

rightAlignedTextField.setHorizontalAlignment(SwingConstants.RIGHT);
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9895027
;-)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now