[5988] in java-interest
RE: Combo Box
daemon@ATHENA.MIT.EDU (Lee Collins)
Thu Mar 7 16:55:18 1996
Date: Thu, 07 Mar 1996 14:05:26 -0600
To: eric@onshore.com
From: Lee Collins <Spacely@xsite.net>
Cc: java-interest@java.sun.com
To: eric@onshore.com.java-interest@java.sun.com
From: Lee Collins <Spacely@xsite.net>
Subject: Re: Combo Box
Have you tried creating a NEW class which contains an editable TextField and
a popup menu. This should probably extend Component. You may have to do a
little work to relate the components the way a Combo Box works but I don't
think this is hard at all.
Something like:
class ComboBox extends Component
{
TextField theText;
Menu theMenu;
ComboBox( )
{
super();
theText = new TextField();
theMenu = new Menu();
};
ComboBox(String[] theStrings)
{
ComboBox();
// add the strings
}
};
>
>Hi all,
>
>I need to implement a Windows-style "Combo box". In other words, it's sorta
>like the Choice class, but the text in the TextField is editable. I've
>tried a nuber of things that I'd like to outline here.
>
>* Thinking originally that this class was composed of a popup menu and a
>Textfield, I thought if I could go in and make a new class with the
>textfield editable, it would work. No. It seems to call a Peer.
>
>* I was able to overlap a new textfield over the textfield part of Choice,
>but don't feel comfortable with this. Tabbing would be screwed up, though I
>couldn't test it as I was running Windows and tabbing doesn't work.
>
>* Tried to simulate it. Tried to use Lists that would show() and hide(), but
>it also doesn't seem very clean. Plus, the Panel would be oversized to
>accomodate the larger size of the list.
>
>*Looked into Menu's, but haven't seen any way to make them appear anywhere
>(like popup menu).
>
>Does anyone have any ideas on this?
>
>Thanks,
>Eric
>
>-
>This message was sent to the java-interest mailing list
>Info: send 'help' to java-interest-request@java.sun.com
>
>
>
>
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com