Results 1 to 2 of 2
  1. #1
    cotarelo is offline Member
    Join Date
    Mar 2010
    Posts
    43
    Rep Power
    0

    Default Selecting last item from a Jcombobox wont work

    I want a simple thing. everytime I press a button, the last item from a combobox is selected.

    Why this wont work?

    Java Code:
    combobox.setSelectedItem(combobox.getItemCount()-1);

  2. #2
    cotarelo is offline Member
    Join Date
    Mar 2010
    Posts
    43
    Rep Power
    0

Similar Threads

  1. JApplet buttons wont work
    By Mark101 in forum New To Java
    Replies: 3
    Last Post: 03-16-2010, 06:53 PM
  2. Why wont import jm.util.*; work??
    By cakepizza in forum New To Java
    Replies: 2
    Last Post: 01-01-2010, 11:19 PM
  3. Creating multiline item in JComboBox
    By javabud in forum AWT / Swing
    Replies: 2
    Last Post: 07-17-2009, 03:50 PM
  4. [SOLVED] Item too big for JComboBox
    By nwboy74 in forum AWT / Swing
    Replies: 5
    Last Post: 02-23-2009, 08:21 PM
  5. save will work but load wont?!?!
    By Sticks_ll in forum New To Java
    Replies: 1
    Last Post: 06-12-2008, 04:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •