title: How can I make combobox's list wider?
body: <pre><code>import javax.swing.*;
  
  public class test
  {   
      public static void main(String[] args) throws Exception
      {
          JFrame frame = new JFrame(&quot;Test&quot;);
          frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
          frame.setSize(120,80);      
          JComboBox cb = new JComboBox();
          cb.addItem(&quot;A very long combo-box item that doesn't fit no. 1&quot;);
          cb.addItem(&quot;A very long combo-box item that doesn't fit no. 2&quot;);
          frame.add(cb);
          frame.validate();
          frame.setVisible(true);
      }
  }
  </code></pre>
  <p>How can I make combo-box items to appear in the way that all their text is visible?<br />
  Now I have something like this:<br />
  <img src="https://i.stack.imgur.com/Kcqsn.png" alt="enter image description here" /><br />
  I don't want to change size of combo-box while collapsed.<br />
  I just want to increase width of the expanded part.</p>