Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

TextField Alignment - Urgent  RSS feed

 
Sri Ram
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends
Please tell me how to set Right Alignment for a TextField (not JTExtField). This is urgent
Please reply
regards
sriram
 
Premila
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If the reference for ur textfield is jTextField1, then
jTextField1.setHorizontalAlignment(SwingConstants.RIGHT);

Originally posted by Sri Ram:
Dear Friends
Please tell me how to set Right Alignment for a TextField (not JTExtField). This is urgent
Please reply
regards
sriram

 
Karen Parker
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, it is not possible to change the horizontal (or vertical) alignment of an AWT Textfield. In order to get this functionality, you will either have to use Swing (JTextfield), or write your own custom component.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!