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 4 of 4

Thread: JComboBoxes & Events

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default JComboBoxes & Events

    Hello all.

    I'm trying to figure out how to get a JTextField contents to change, based on what the user's current JComboBox selection is. I can get it to do it with JCheckBoxes, but I'm not understanding how to get the JComboBox to change it? I managed to get my JComboBox to change at one point, but it just continued to add (i'm changing numbers in a box) the numbers together, instead of just replacing them.

    Do I use ItemListener or ActionHandler for this type of activity?


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: JComboBoxes & Events

    Without more details and code its tough to provide specific suggestions, but I'd recommend looking into adding an ItemListener to your JComboBox to list for changes in JComboBox selections.

  3. #3

  4. #4
    Junior Member
    Join Date
    Apr 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JComboBoxes & Events

    Hi kevinGreen!
    u can easily achieve that if you are a netbeans user. There is a tab under GUI design that is called Connection of events.

Similar Threads

  1. 'MouseUp' Drag and Drop Events
    By copeg in forum AWT / Java Swing
    Replies: 0
    Last Post: November 10th, 2009, 07:21 PM