title: How to create a multi-layer JComboBox
body: <p>I'm creating a simulator using Java Swing. I used JComboBox to display units of utilities such as "KW, KL, KM" etc to measure Power, Water and distance. It's simple to add bunch of items to a JComboBox. User select a unit and the JFrame will save the selection when a "save" button is clicked. </p>
  
  <pre><code>    JComboBox comboBox = new JComboBox();
      for(ValueUnits u: ValueUnits.values()){
          comboBox.addItem(u.returnUnits());
      }
  
      comboBox.setSelectedIndex(-1);
      unitColumn.setCellEditor(new DefaultCellEditor(comboBox));
  </code></pre>
  
  <p>Now I want to create an multi-layer JComboBox (perhaps JMenu?). The function of such should behave as a multi-layer JMenu. When the JComboBox is clicked, it will show the first layer - category such as "Electricity, Water, Distance...", Then when mouse hover over Electricity, a list of Electricity units such as "KW, MW, W ..." will show. These collections are fetched from Enumerations. I wonder what's the most correct way to create such component. </p>
  
  <p>Thank you so much world!</p>