• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextField - is it possible to scroll text in a text field.

 
maniyar Khalandar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I need help, i want to know if it is possible to scroll text in JTextfield or in Jtext area.
Thanks in advance
 
T Pelly
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Haven't tried to do it in a JTextField, but it's possible in a JTextArea...
Use a JScrollPane.
The code should look something like this:
private JTextArea textyA = new JTextArea("",rows,colums);
JScrollPane scroller = new JScrollPane(textyA);
add(scroller);
Hope that's helped
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...i want to know if it is possible to scroll text in JTextfield...
I am pretty sure (damn! where did I read this?) you can't
have scrollbar in TextField. You have to use the left and
right arrow keys. However, you can controll the length of
the TextField that is displayed.
regds.
- satya
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!