The Choice component does not display correctly on startup if no item was added using the addItem method ie. there are no items to select. The component will display a flat line not resembling a proper GUI control.
Here is a test case:
import java.awt.*;
public class ChoiceNone extends Frame
{
public ChoiceNone()
{
setTitle("Choice Box Test");
Choice c = new Choice();
// do not add any items to select
// c.addItem("Item");
add("Center", c);
resize(200,300);
show();
}
public static void main (String[] args )
{
new ChoiceNone();
}
}
Name: rrT76497 Date: 05/05/98
ecjohn May 06,98. Already available in db
----------------------------------------------------------------------------
------
SIP Technologies & Exports Ltd. | SIPtech ...
G4, Elnet Software City, CPT Road |
Taramani, Madras 600 113, India. | Delivering Values
Phone : +91-44-235 4473, +91-44-235 4474 |
Fax : +91-44-235 4475 |
Email : ###@###.### |
----------------------------------------------------------------------------
------
======================================================================
Here is a test case:
import java.awt.*;
public class ChoiceNone extends Frame
{
public ChoiceNone()
{
setTitle("Choice Box Test");
Choice c = new Choice();
// do not add any items to select
// c.addItem("Item");
add("Center", c);
resize(200,300);
show();
}
public static void main (String[] args )
{
new ChoiceNone();
}
}
Name: rrT76497 Date: 05/05/98
ecjohn May 06,98. Already available in db
----------------------------------------------------------------------------
------
SIP Technologies & Exports Ltd. | SIPtech ...
G4, Elnet Software City, CPT Road |
Taramani, Madras 600 113, India. | Delivering Values
Phone : +91-44-235 4473, +91-44-235 4474 |
Fax : +91-44-235 4475 |
Email : ###@###.### |
----------------------------------------------------------------------------
------
======================================================================
- duplicates
-
JDK-4031460 Empty choice alignment is off. Fixed when add item to choice.
- Closed