ComboBox: no longer ignore JComboBox.prototypeDisplayValue when computing popup width (issue #80)

This commit is contained in:
Karl Tauber
2020-03-31 18:53:55 +02:00
parent 97d5792341
commit d094709dc8
6 changed files with 7 additions and 14 deletions

View File

@@ -310,14 +310,13 @@ class BasicComponentsPanel
add(comboBox4, "cell 4 4,growx");
//---- comboBox5 ----
comboBox5.setPrototypeDisplayValue("12345");
comboBox5.setModel(new DefaultComboBoxModel<>(new String[] {
"wide popup if text is longer",
"aa",
"bbb",
"cccc"
}));
add(comboBox5, "cell 5 4,growx");
add(comboBox5, "cell 5 4,growx,wmax 100");
//---- spinnerLabel ----
spinnerLabel.setText("JSpinner:");

View File

@@ -242,7 +242,6 @@ new FormModel {
} )
add( new FormComponent( "javax.swing.JComboBox" ) {
name: "comboBox5"
"prototypeDisplayValue": "12345"
"model": new javax.swing.DefaultComboBoxModel {
selectedItem: "wide popup if text is longer"
addElement( "wide popup if text is longer" )
@@ -251,7 +250,7 @@ new FormModel {
addElement( "cccc" )
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 4,growx"
"value": "cell 5 4,growx,wmax 100"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "spinnerLabel"