import javax.swing.*;
public class test
{
public static void main(String[] args) throws Exception
{
JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setSize(120,80);
JComboBox cb = new JComboBox();
cb.addItem("A very long combo-box item that doesn't fit no. 1");
cb.addItem("A very long combo-box item that doesn't fit no. 2");
frame.add(cb);
frame.validate();
frame.setVisible(true);
}
}
How can I make combo-box items to appear in the way that all their text is visible?
Now I have something like this:

I don’t want to change size of combo-box while collapsed.
I just want to increase width of the expanded part.
I think this may help.
Code from link