🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #10709

JComboBox - setSelectedItem doesn't work

#10709
From: Robert Laird
Date: Fri, 20 Aug 1999 00:00
17 lines
910 bytes
I have a simple JComboBox, that I add items to:

  jComboBox1.addItem("100.123.456.789");
  jComboBox1.addItem("100.123.456.790");
  jComboBox1.addItem("100.123.456.791");

If, when I present this ComboBox to the user, I
want to have item # 2 already selected, then I try:

  jComboBox1.setSelectedItem("100.123.456.790");

But when it comes up, it always has item #1 
selected.  

Any hints, suggestions?  Thanks!

  -- Robert
Technical Details
Message-ID: <01beeb0e$8bc0f220$238eabc6@rtlaird>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,699b2bb1d7db8f99,start
X-Google-Attributes: gid111d45,public
From: "Robert Laird" <rlaird@energy-trading.com (remove - )>
Subject: JComboBox - setSelectedItem doesn't work
Date: 1999/08/20
Message-ID: <01beeb0e$8bc0f220$238eabc6@rtlaird>
X-Deja-AN: 515106798
Organization: DETM
Reply-To: "Robert Laird" <rlaird@energy-trading.com (remove -)>
Newsgroups: borland.public.jbuilder.java.swing