• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextArea.requestFocus() leaves a single space.  RSS feed

 
Nikolas Nikolaou
Ranch Hand
Posts: 101
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I've made a small GUI app where you enter a website Into a JTextArea (area) and It appends It to "<a href=http://.....
The problem I have Is the area.requestFocus() leaves a single space and the href ends up as <a href=http:// www.whatever.com with a single space between // and www.
Is there a way to move the focus one space to the left or to backspace the appended website ?
 
Paul Clapham
Sheriff
Posts: 22834
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It isn't the call to requestFocus() which is inserting that space character. So it must be something else. Would you like to post an SSCCE (<== follow that link to see what I'm asking for) which demonstrates the problem?
 
Nikolas Nikolaou
Ranch Hand
Posts: 101
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.


That must be It.I forgot about that line till you mentioned It wasn't the requestFocus() that's causing the space.
I need to empty the JTextArea without the space.
 
Liutauras Vilda
Sheriff
Posts: 4923
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nikolas Nikolaou wrote:

I need to empty the JTextArea without the space.


 
Nikolas Nikolaou
Ranch Hand
Posts: 101
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For some silly reason I thought you had to setText(" ") with a space.I never tried setText("") !
Sorry for wasting your time !
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does it say about the beginning forum?

I have remembered:
No question too simple or small . . .
So don't worry about it; we have all done the same sort of thing.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!