import javax.swing.*;
import java.awt.*;

public class ComboBoxBugExample {
    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            JFrame frame = new JFrame("Bug Example");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setLayout(null);

            JComboBox<String> comboBox = new JComboBox<>(new String[]{
                    "Short",
                    "A much longer item to test",
                    "The longest item in the combo box"
            });

            comboBox.setBounds(50, 50, 150, 30);
            comboBox.setPrototypeDisplayValue("The longest item in the combo box");

            frame.add(comboBox);
            frame.setSize(400, 300);
            frame.setVisible(true);
        });
    }
}