// Popup invoker button
final WebButton showPopup = new WebButton ( "Show simple popup" );
// Popup style chooser
final WebComboBox popupStyle = new WebComboBox ( PopupStyle.values () );
popupStyle.setSelectedItem ( PopupManager.getDefaultPopupStyle () );
popupStyle.setRenderer ( new WebComboBoxCellRenderer ()
{
@Override
public Component getListCellRendererComponent ( final JList list, final Object value, final int index, final boolean isSelected,
final boolean cellHasFocus )
{
return super.getListCellRendererComponent ( list, "Style: " + value, index, isSelected, cellHasFocus );
}
} );
popupStyle.addActionListener ( new ActionListener ()
{
@Override
public void actionPerformed ( final ActionEvent e )
{
popup.setPopupStyle ( ( PopupStyle ) popupStyle.getSelectedItem () );
popup.packPopup ();
}
} );
// Popup show/hide action