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.

Page 2 of 2 FirstFirst 12
Results 26 to 32 of 32

Thread: n00b asking jspinner question

  1. #26
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: n00b asking jspinner question

    Is your problem that you don't want the contents to be selected?
    You can probably add a listener and have it turn off the selection.
    If you don't understand my answer, don't ignore it, ask a question.

  2. The Following User Says Thank You to Norm For This Useful Post:

    john123 (March 24th, 2012)

  3. #27
    Junior Member
    Join Date
    Mar 2012
    Posts
    18
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default Re: n00b asking jspinner question

    Yes,when i accidentally double click on it ,i dont want contents to be selected ,but that doesn't mean that i am not using
    manual or desired mouse focus selection ,so its not like i can turn off the focus.
    Do you mean i can add a mouse double click listener ,or some other kind?

  4. #28
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: n00b asking jspinner question

    What is the difference between an accidental selection and a desired selection?
    If you don't understand my answer, don't ignore it, ask a question.

  5. The Following User Says Thank You to Norm For This Useful Post:

    john123 (March 24th, 2012)

  6. #29
    Junior Member
    Join Date
    Mar 2012
    Posts
    18
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default Re: n00b asking jspinner question

    Accidental is when i double click accidentally so the focus is in the whole content and that annoys my desired mouse selection
    that trys to select only few numbers in the field.

  7. #30
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: n00b asking jspinner question

    I think you can unselect when a selection has been made. See the caretlistener and use the caret setting methods.
    If you don't understand my answer, don't ignore it, ask a question.

  8. The Following User Says Thank You to Norm For This Useful Post:

    john123 (March 24th, 2012)

  9. #31
    Junior Member
    Join Date
    Mar 2012
    Posts
    18
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default Re: n00b asking jspinner question

    Quote Originally Posted by Norm View Post
    I think you can unselect when a selection has been made. See the caretlistener and use the caret setting methods.
    Thanks, i will try that

  10. #32
    Junior Member
    Join Date
    Mar 2012
    Posts
    18
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default Re: n00b asking jspinner question

    Quote Originally Posted by Norm View Post
    I think you can unselect when a selection has been made. See the caretlistener and use the caret setting methods.
    Yess! I Done it!
    I just want to brag a little ,this is big thing for a n00b
    I use a mouse listener and it works perfectly:


    	textField.addMouseListener(new MouseAdapter() {
    							public void mousePressed(MouseEvent e) {
    								if (e.getClickCount() == 1 ) {
    								  d = textField.getCaret().getMark();  			
    								}
    								 if (e.getClickCount() == 2 ) {
    									textField.setCaretPosition(d);
    								}
    							}	
    	                      });
    Last edited by john123; March 25th, 2012 at 07:02 AM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [SOLVED] n00b having problems running code
    By cha0s619 in forum What's Wrong With My Code?
    Replies: 10
    Last Post: November 10th, 2012, 04:31 PM
  2. Remove focus from JSpinner?
    By hafunui in forum AWT / Java Swing
    Replies: 4
    Last Post: June 16th, 2011, 04:17 PM
  3. Really Quick n00b question, should take three seconds to answer
    By joeschmidt45 in forum Java Theory & Questions
    Replies: 4
    Last Post: February 24th, 2011, 05:23 AM
  4. Help with JSpinner Problem
    By leoeroz in forum AWT / Java Swing
    Replies: 0
    Last Post: December 25th, 2010, 12:42 PM
  5. Java n00b
    By Campos in forum AWT / Java Swing
    Replies: 6
    Last Post: July 22nd, 2009, 09:26 AM