I have write a code which displays some Buttons and a TextField, when I press button, it sets the text in the non editable TextField. First Problem: Now the problem is this that when the text is out of range of displayed area of TextField it doesn't shows that, to see that text I need to take the cursor to the last character. So, I want that as I press the Button the cursor should be in front of that character. Second Problem: I have wrote the following code in the ActionPerformed method. When I press the button, it gives the feeling that graphic's is being refreshed. So, can I do something to prevent it.