File tree Expand file tree Collapse file tree
modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/toolkit/table Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,7 +62,21 @@ public CMComboBoxCellEditor(JComboBox<?> comboBox) {
6262 comboBox .addPopupMenuListener (new PopupMenuListener () {
6363 @ Override
6464 public void popupMenuWillBecomeVisible (PopupMenuEvent e ) {
65+ // First call: sets popup.preferredSize so the popup *window* is created at the
66+ // correct width (window size is determined from popup.preferredSize before show()).
6567 adjustPopupWidth ();
68+ // Second call via invokeLater: BasicComboPopup.show() calls getPopupLocation()
69+ // *after* firing this listener, which re-constrains scroller.maxSize back to the
70+ // column width. Running again on the next EDT cycle fixes the scroller, then
71+ // revalidate/repaint forces the layout to update inside the already-wide window.
72+ SwingUtilities .invokeLater (() -> {
73+ adjustPopupWidth ();
74+ Object child = comboBox .getUI ().getAccessibleChild (comboBox , 0 );
75+ if (child instanceof JPopupMenu popup ) {
76+ popup .revalidate ();
77+ popup .repaint ();
78+ }
79+ });
6680 }
6781 @ Override public void popupMenuWillBecomeInvisible (PopupMenuEvent e ) {}
6882 @ Override public void popupMenuCanceled (PopupMenuEvent e ) {}
You can’t perform that action at this time.
0 commit comments