Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: having trouble with JTextField selectAll method

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question having trouble with JTextField selectAll method

    I'm attempting to use the selectAll() method of javax.swing.JTextField. I was expecting to see all the text in the JTextField on my GUI screen displayed as if I had double-clicked the field from the GUI (the default white text on a blue background). Instead I see no apparent change to the GUI display.

    - What don't I understand?
    - How do I do what I'm trying to do?

    Spike


  2. #2
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    1,069
    Thanks
    7
    Thanked 215 Times in 191 Posts

    Default Re: having trouble with JTextField selectAll method

    By "the default white text on a blue background" do you mean a window's title bar?

    With some desktop managers double clicking the title bar changes the window's size, but this has nothing to do with selectAll(). (Or Java, really.) selectAll() causes all of the text in the field to become selected: visually it is shown with a background colour, and can be copied, deleted etc.

  3. #3
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: having trouble with JTextField selectAll method

    Quote Originally Posted by Daddyspike View Post
    I'm attempting to use the selectAll() method of javax.swing.JTextField.
    Do you mean the selectAll method inherited from JTextComponent?
    Did you use it correctly? Are you sure the code block containing the statement is being called?
    Post the code you have problems with. Its hard to offer much help without something to look at

Similar Threads

  1. Having trouble storing variable from JTextField
    By sibs in forum What's Wrong With My Code?
    Replies: 32
    Last Post: December 1st, 2012, 08:39 AM
  2. Trouble with JTextfield
    By loui345 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: December 1st, 2012, 08:22 AM
  3. [SOLVED] Trouble clearing JTextField, getting NullPointerException
    By Lanst83 in forum AWT / Java Swing
    Replies: 11
    Last Post: September 22nd, 2012, 07:37 PM
  4. isEnabled() method for Jtextfield
    By harsimran in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 10th, 2011, 11:07 PM
  5. Trouble with Binary Search on Insert Method
    By EricSt in forum Algorithms & Recursion
    Replies: 1
    Last Post: February 17th, 2010, 10:34 PM