Search:

Type: Posts; User: javapenguin

Search: Search took 0.12 seconds.

  1. Replies
    14
    Views
    3,151

    Re: Auto Select

    I don't know why you can't just tell it to selectAll() in the MouseListener without even bothering with another class. But if you must, what I posted should work.
  2. Replies
    14
    Views
    3,151

    Re: Auto Select

    Change it to JTextField if you want, though it'll still work as JTextComponent as parameter for the static method. In fact, the way I have it, it'll work with JTextAreas too.
  3. Replies
    14
    Views
    3,151

    Re: Auto Select

    #-o#-o#-o#-o

    Now I get what you wanted.

    Here's what you should do.

    Create a class called AutoSelect that has a static method that takes a textField(or TextArea), whichever you're using , and...
  4. Replies
    14
    Views
    3,151

    Re: Auto Select

    If it's an instance of JTextField, why cast it at all? (Maybe I'm wrong here.)

    You're selecting all the text, but it appears you're doing nothing with it.

    Anyway, you can set the background...
Results 1 to 4 of 4