Example usage for java.awt List remove

List of usage examples for java.awt List remove

Introduction

In this page you can find the example usage for java.awt List remove.

Prototype

public void remove(int position) 

Source Link

Document

Removes the item at the specified position from this scrolling list.

Usage

From source file:org.yccheok.jstock.gui.MainFrame.java

public void createCountryMenuItem() {
    java.util.List<Country> countries = new ArrayList<Country>(Arrays.asList(Country.values()));
    // Czech is only for currency exchange purpose.
    countries.remove(Country.Czech);

    for (final Country country : countries) {
        // Ugly fix on spelling mistake.
        final JMenuItem mi;
        mi = (JRadioButtonMenuItem) jMenu6
                .add(new JRadioButtonMenuItem(country.toHumanReadableString(), country.getIcon()));

        buttonGroup2.add(mi);// ww  w.j ava2 s .  co  m
        mi.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                MainFrame.this.changeCountry(country);
            }
        });

        if (jStockOptions.getCountry() == country) {
            ((JRadioButtonMenuItem) mi).setSelected(true);
        }
    }
}