public void mousePressed(MouseEvent e){ if((JMenu)e.getSource() == label) label.setPopupMenuVisible(false); }  public void mouseReleased(MouseEvent e){ if((JMenu)e.getSource() == label){ label.setPopupMenuVisible(true); } } });
public void mousePressed(MouseEvent e){ if((JMenu)e.getSource() == label) label.setPopupMenuVisible(false); }  public void mouseReleased(MouseEvent e){ label.setPopupMenuVisible(false); if((JMenu)e.getSource() == label){ if(label.isSelected()) label.setPopupMenuVisible(true); } }  });
	    public CascadedComboBox(){		label = new JMenu();		label.addMouseListener(new MouseInputAdapter(){	  		// Re-define mouse listener so that drag is not available			public void mousePressed(MouseEvent e){			    if((JMenu)e.getSource() == label)				label.setPopupMenuVisible(false);			}						public void mouseReleased(MouseEvent e){			    if((JMenu)e.getSource() == label){ 				label.setPopupMenuVisible(true);			    }			}					    });				if(m_ObjectNames.depth() > 0){		    try{			m_ObjectNames.goToRoot();			build();			    }catch(Exception e){			e.printStackTrace();			System.err.println(e.getMessage());		    }	    		    if(m_Object != null)			setLabel(m_Object.getClass().getName());		}	    }