-
Bug
-
Resolution: Duplicate
-
P1
-
None
-
1.0
-
None
-
sparc
-
solaris_2.4
import java.awt.*;
public class testcase extends java.applet.Applet {
// a slot to hold an arbitrary object pointer that can
// be filled in by the app. and referenced in actions
public Object arg;
public Choice menubutton_1;
//methods to support form introspection
public static String names[] = {
"menubutton_1",
};
public String[] getNames() {
return names;
}
//There should be an easier way to do this
public Object[] getWidgets() {
Object[] list = new Object[1];
list[0] = menubutton_1;
return list;
}
public void init() {
// main panel
GridBagLayout grid = new GridBagLayout();
int rowHeights[] = {0,30,30,30};
int columnWidths[] = {0,30,30,30};
double rowWeights[] = {0.0,0.0,0.0,0.0};
double columnWeights[] = {0.0,0.0,0.0,0.0};
grid.rowHeights = rowHeights;
grid.columnWidths = columnWidths;
grid.rowWeights = rowWeights;
grid.columnWeights = columnWeights;
menubutton_1 = new Choice();
/* menubutton_1.addItem("xyz"); */
this.add(menubutton_1);
// Geometry management
GridBagConstraints con = new GridBagConstraints();
reset(con);
con.gridx = 2;
con.gridy = 2;
con.anchor = GridBagConstraints.CENTER;
con.fill = GridBagConstraints.NONE;
grid.setConstraints(menubutton_1, con);
// Resize behavior management and parent heirarchy
setLayout(grid);
// Give the application a chance to do its initialization
super.init();
}
public boolean handleEvent(Event event) {
return super.handleEvent(event);
}
public static void main(String[] args) {
Frame f = new Frame("testcase Test");
testcase win = new testcase();
win.init();
f.add("Center", win);
f.pack();
f.show();
}
private void reset(GridBagConstraints con) {
con.gridx = GridBagConstraints.RELATIVE;
con.gridy = GridBagConstraints.RELATIVE;
con.gridwidth = 1;
con.gridheight = 1;
con.weightx = 0;
con.weighty = 0;
con.anchor = GridBagConstraints.CENTER;
con.fill = GridBagConstraints.NONE;
con.insets = new Insets(0, 0, 0, 0);
con.ipadx = 0;
con.ipady = 0;
}
}
public class testcase extends java.applet.Applet {
// a slot to hold an arbitrary object pointer that can
// be filled in by the app. and referenced in actions
public Object arg;
public Choice menubutton_1;
//methods to support form introspection
public static String names[] = {
"menubutton_1",
};
public String[] getNames() {
return names;
}
//There should be an easier way to do this
public Object[] getWidgets() {
Object[] list = new Object[1];
list[0] = menubutton_1;
return list;
}
public void init() {
// main panel
GridBagLayout grid = new GridBagLayout();
int rowHeights[] = {0,30,30,30};
int columnWidths[] = {0,30,30,30};
double rowWeights[] = {0.0,0.0,0.0,0.0};
double columnWeights[] = {0.0,0.0,0.0,0.0};
grid.rowHeights = rowHeights;
grid.columnWidths = columnWidths;
grid.rowWeights = rowWeights;
grid.columnWeights = columnWeights;
menubutton_1 = new Choice();
/* menubutton_1.addItem("xyz"); */
this.add(menubutton_1);
// Geometry management
GridBagConstraints con = new GridBagConstraints();
reset(con);
con.gridx = 2;
con.gridy = 2;
con.anchor = GridBagConstraints.CENTER;
con.fill = GridBagConstraints.NONE;
grid.setConstraints(menubutton_1, con);
// Resize behavior management and parent heirarchy
setLayout(grid);
// Give the application a chance to do its initialization
super.init();
}
public boolean handleEvent(Event event) {
return super.handleEvent(event);
}
public static void main(String[] args) {
Frame f = new Frame("testcase Test");
testcase win = new testcase();
win.init();
f.add("Center", win);
f.pack();
f.show();
}
private void reset(GridBagConstraints con) {
con.gridx = GridBagConstraints.RELATIVE;
con.gridy = GridBagConstraints.RELATIVE;
con.gridwidth = 1;
con.gridheight = 1;
con.weightx = 0;
con.weighty = 0;
con.anchor = GridBagConstraints.CENTER;
con.fill = GridBagConstraints.NONE;
con.insets = new Insets(0, 0, 0, 0);
con.ipadx = 0;
con.ipady = 0;
}
}
- duplicates
-
JDK-1232064 Displaying an empty Choice widget crashes. Solaris only.
- Closed