Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #794

Re: JComboBox pulldown pr

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Paul Hunter" <paul.hunter@THRWHITE.remove-dii-this>
Subject Re: JComboBox pulldown pr
Message-ID <AeydnfJPGN0YESTYnZ2dnUVZ_vupnZ2d@comcast.com> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
In-Reply-To <1169786862.048949.39520@s48g2000cws.googlegroups.com>
References <1169786862.048949.39520@s48g2000cws.googlegroups.com>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 70
Date Wed, 27 Apr 2011 15:29:36 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303918176 96.60.20.240 (Wed, 27 Apr 2011 10:29:36 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:29:36 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:794

Show key headers only | View raw


  To: comp.lang.java.gui
One SSCCE as requested:

import java.awt.*;
import javax.swing.*;
public class test1 extends JFrame {

    public test1 () {

        super();
        setSize(200,200);

        Container rootPane = getRootPane();

        rootPane.setLayout(new FlowLayout());

        String[] list = {"one", "two", "three"};
        JComboBox box = new JComboBox(list);

        box.setEditable(true);
        rootPane.add(box);

    }

    public static void main (String[] args) {

        test1 s = new test1();

        s.run();

    }

    public void run () {

        setVisible(true);

    }
}

"Andrew Thompson" <andrewthommo@gmail.com> wrote in message 
news:1169786862.048949.39520@s48g2000cws.googlegroups.com...
> On Jan 26, 3:19 pm, "Paul Hunter" <baseball...@comcast.net> wrote:
>> It's been awhile since I used Swing, and I ran into an issue. I wanted to
>> have a pulldown text choice widget using a JComboBox with the following
>> code:
>>
>>   String[] list = {"one", "two", "three"};
>>   JComboBox companyName = new JComboBox(list);
>>   companyName.setEditable(true);
>
>     getContentPane().add( companyName );
>     validate();
>
>> However, the pulldown menu does not appear when the arrow is pressed. 
>> What
>> am I missing?
>
> Try the above, if that fails, I suggest
> you prepare an SSCCE..
> <http://www.physci.org/codes/sscce>
>
> HTH
>
> Andrew T.
>

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar


Thread

Re: JComboBox pulldown pr "Paul Hunter" <paul.hunter@THRWHITE.remove-dii-this> - 2011-04-27 15:29 +0000
  Re: JComboBox pulldown pr "tar" <tar@THRWHITE.remove-dii-this> - 2011-04-27 15:29 +0000

csiph-web