Package java.awt

Examples of java.awt.Choice$ChoiceStateController


        for (int ci = 0; ci < count; ci++) {
          setValue(name, objs[ci].toString());
        }
      }
    } else if (c instanceof Choice) {
      Choice choice = (Choice) c;
      Object[] objs = choice.getSelectedObjects();
      if (objs != null) {
        int count = objs.length;
        for (int ci = 0; ci < count; ci++) {
          setValue(name, objs[ci].toString());
        }
View Full Code Here


   *
   * @return Choice
   */
  private Choice getChoice() {
    if (choice == null) {
      choice = new Choice();
      choice.addItem("-- blank --"); // 1st one is blank, don't change
      /*
       * Note: the item string must end with REQUEST or RESPONSE. It's
       * used to set radio buttons
       */
 
View Full Code Here

   * @return java.awt.Choice
   */
  private Choice getMessageOutputLevelChoice() {
    if (iMessageOutputLevelChoice == null) {
      try {
        iMessageOutputLevelChoice = new Choice();
        iMessageOutputLevelChoice.setName("MessageOutputLevelChoice");
        iMessageOutputLevelChoice.add("Error");
        iMessageOutputLevelChoice.add("Warning");
        iMessageOutputLevelChoice.add("Info");
        iMessageOutputLevelChoice.add("Verbose");
View Full Code Here

      }
  }
 

  protected void createRulesChoice() {
      crule = new Choice();
      String names[] = Rule.getRulesName();
      for (int i=0; i < names.length; i++) {
    crule.add(names[i]);
      }
      crule.addItemListener(this);
View Full Code Here

      }
      crule.addItemListener(this);
  }

  protected void createArgsChoice() {
      cargs = new Choice();
      hargs = new Hashtable(10);
      cargs.addItemListener(this);
  }
View Full Code Here

        b.setForeground(Color.orange);
        add(b = new Checkbox(null, group, true));
        b.addItemListener(this);
        b.setForeground(Color.black);
        target.setForeground(b.getForeground());
        Choice shapes = new Choice();
        shapes.addItemListener(this);
        shapes.addItem("Lines");
        shapes.addItem("Points");
        shapes.setBackground(Color.lightGray);
        add(shapes);
    }
View Full Code Here

        c.fill = GridBagConstraints.HORIZONTAL;

        // Build the two menus for selecting which calendar is displayed,
        // plus the month/year label for each calendar
        for (int i = 0; i < 2; i++) {
            calMenu[i] = new Choice();
            for (int j = 0; j < CALENDARS.length; j++) {
                calMenu[i].addItem(CALENDARS[j].name);
            }
            calMenu[i].setBackground(DemoUtility.choiceColor);
            calMenu[i].select(i);
            calMenu[i].addItemListener(new CalMenuListener());

            // Label for the current month name
            monthLabel[i] = new ColoredLabel("", COLORS[i]);
            monthLabel[i].setFont(DemoUtility.titleFont);

            // And the default calendar to use for this slot
            calendars[i] = CALENDARS[i].calendar;

            add(topPanel, calMenu[i], g, c, 5, 0);
            add(topPanel, monthLabel[i], g, c, GridBagConstraints.REMAINDER, 1);
        }

        // Now add the next/previous year/month buttons:
        prevYear = new Button("<<");
        prevYear.addActionListener(new AddAction(Calendar.YEAR, -1));

        prevMonth = new Button("<");
        prevMonth.addActionListener(new AddAction(Calendar.MONTH, -1));

        gotoToday = new Button("Today");
        gotoToday.addActionListener( new ActionListener()
        {
            public void actionPerformed(ActionEvent e) {
                calendarPanel.setDate( new Date() );
                updateMonthName();
            }
        } );

        nextMonth = new Button(">");
        nextMonth.addActionListener(new AddAction(Calendar.MONTH, 1));

        nextYear = new Button(">>");
        nextYear.addActionListener(new AddAction(Calendar.YEAR, 1));

        c.fill = GridBagConstraints.NONE;
        add(topPanel, prevYear,  g, c, 1, 0);
        add(topPanel, prevMonth, g, c, 1, 0);
        add(topPanel, gotoToday, g, c, 1, 0);
        add(topPanel, nextMonth, g, c, 1, 0);
        add(topPanel, nextYear,  g, c, 1, 0);

        // Now add the menu for selecting the display language
        Panel displayPanel = new Panel();
        {
            displayMenu = new Choice();
            Locale defaultLocale = Locale.getDefault();
            int bestMatch = -1, thisMatch = -1;
            int selectMe = 0;
           
            for (int i = 0; i < locales.length; i++) {
View Full Code Here

            monthLabel.setFont(new Font(DemoUtility.titleFont.getName(),
                                        DemoUtility.titleFont.getStyle(),
                                        (DemoUtility.titleFont.getSize() * 3)/2));

            // Make the locale popup menus
            localeMenu= new Choice();
            localeMenu.addItemListener(this);
            int selectMe = 0;
           
            for (int i = 0; i < calendars.length; i++) {
                if (i > 0 &&
                        calendars[i].getCountry().equals(calendars[i-1].getCountry()) ||
                    i < calendars.length - 1 &&
                        calendars[i].getCountry().equals(calendars[i+1].getCountry()))
                {
                    localeMenu.addItem(calendars[i].getDisplayCountry() + " (" +
                                    calendars[i].getDisplayLanguage() + ")");
                } else {
                    localeMenu.addItem( calendars[i].getDisplayCountry() );
                }
               
                if (calendars[i].equals(kFirstLocale)) {
                    selectMe = i;
                }
            }
           
            localeMenu.setBackground(DemoUtility.choiceColor);
            localeMenu.select(selectMe);

            displayMenu = new Choice();
            displayMenu.addItemListener(this);
           
            selectMe = 0;
            for (int i = 0; i < locales.length; i++) {
                if (i > 0 &&
View Full Code Here

        txtCommand = new TextArea(5, 40);

        txtCommand.setFont(fFont);

        // recent - choice
        choRecent = new Choice();

        // result - grid
        gResult = new Grid();

        // combine it
View Full Code Here

        p.addKeyListener(this);
        p.setBackground(SystemColor.control);
        p.add(createLabel("Type:"));

        Choice types = new Choice();

        types.addItemListener(this);
        types.addKeyListener(this);

        for (int i = 0; i < sJDBCTypes.length; i++) {
            types.add(sJDBCTypes[i][0]);
        }

        p.add(types);
        p.add(createLabel("Driver:"));
View Full Code Here

TOP

Related Classes of java.awt.Choice$ChoiceStateController

Copyright © 2018 www.massapicom. 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.