Package java.awt

Examples of java.awt.Choice.select()


                int i = Integer.parseInt(indexStr);
                Choice choice = (Choice) peer.getComponentObject();
                if (choice.getSelectedIndex() != i)
                {
                    _logger.finest("item changes detected on component " + choice);
                    choice.select(i);
                    postEvent(context, new ItemEvent(choice, ItemEvent.ITEM_STATE_CHANGED, choice, ItemEvent.SELECTED));
                }
            } catch (NumberFormatException e)
            {
                _logger.warning("Choice input value is not an integer");
View Full Code Here


    harness.check(c.getSelectedIndex(), -1);
    harness.check(c.getItemCount(), 0);
    c.add("item1");
    harness.check(c.getSelectedIndex(), 0);
    harness.check(c.getItemCount(), 1);
    c.select(0);
    harness.check(c.getSelectedIndex(), 0);
    c.remove(0);
    harness.check(c.getSelectedIndex(), -1);
    harness.check(c.getItemCount(), 0);
   
View Full Code Here

   
    // testing remove with two items
    c.add("item1");
    c.add("item2");
    harness.check(c.getItemCount(), 2);
    c.select(0);
    harness.check(c.getSelectedIndex(), 0);
    c.select(1);
    harness.check(c.getSelectedIndex(), 1);
    c.remove(1);
    harness.check(c.getSelectedIndex(), 0);
View Full Code Here

    c.add("item3");
    harness.check(c.getSelectedIndex(), 0);
    c.add("item4");
    harness.check(c.getSelectedIndex(), 0);   
    harness.check(c.getItemCount(), 4);
    c.select(2);
    harness.check(c.getSelectedIndex(), 2);
    c.select(1);
    harness.check(c.getSelectedIndex(), 1);
    c.remove(1);
    harness.check(c.getSelectedIndex(), 0);
View Full Code Here

    c.add("item4");
    harness.check(c.getSelectedIndex(), 0);   
    harness.check(c.getItemCount(), 4);
    c.select(2);
    harness.check(c.getSelectedIndex(), 2);
    c.select(1);
    harness.check(c.getSelectedIndex(), 1);
    c.remove(1);
    harness.check(c.getSelectedIndex(), 0);
    harness.check(c.getItemCount(), 3);
    c.remove(0);
View Full Code Here

    // testing remove on last index
    c.add("item1");
    c.add("item2");
    c.add("item3");
    harness.check(c.getSelectedIndex(), 0);
    c.select(2);
    harness.check(c.getSelectedIndex(), 2);
    c.remove(2);
    harness.check(c.getSelectedIndex(), 0);
  }
View Full Code Here

                Collections.sort(listaZdarzen);
                for (int i = 0; i < listaZdarzen.size(); i++) {
                    SyberiadaZdarzenie zdarzenie = listaZdarzen.get(i);
                    listaRozwijalna.add(zdarzenie.getId() + "");
                }
                listaRozwijalna.select(selectedID);
                try {
                    XMLParser.getXMLParser().saveXML(listaZdarzen);
                } catch (ParserConfigurationException ex) {
                    Logger.getLogger(Frame.class.getName()).log(Level.SEVERE, null, ex);
                } catch (TransformerConfigurationException ex) {
View Full Code Here

    //Liste déroulante contenant les types de transports possibles
    Choice transportType = new Choice();
    transportType.addItem(TransportType.BUS.toString());
    transportType.addItem(TransportType.METRO.toString());
    transportType.addItem(TransportType.TRAMWAY.toString());
    transportType.select(temp.getTransportType().toString());
   
    String[] stations = controller.getStationsNames();
   
    //Liste déroulante avec système d'auto-complétion contenant les
    //noms des stations
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.