• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Position text field content left side

 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please help me to show the content of the JText field from the starting point (first letter from left - and in below eg. the "haii" should be visible). I tried setting the alignment to LEFT but it did not work. And the text field will not be enabled.

code -
 
Campbell Ritchie
Sheriff
Pie
Posts: 50171
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried it and found nothing wrong with it. Your text is longer than the text field, so you only see its right end. Try with shorter text, eg "Campbell", and you can see it appears as |Campbell       |
 
Maneesh Godbole
Saloon Keeper
Posts: 11165
14
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setCaretPosition(0);
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell - that is the issue... when the text was bigger I want it to show from the starting position. setCaretPositioin(0) is working fine.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> And the text field will not be enabled.

'horses for courses' - a JLabel would not have had this problem.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50171
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Maneesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic