Package java.awt

Examples of java.awt.Checkbox$State


            ((GridLayout) p.getLayout()).setVgap(5);

            final CheckboxGroup cg = new CheckboxGroup();
            final Checkbox[] boxes = new Checkbox[3];
            for (int i = 0; i < 3; ++i) {
                boxes[i] = new Checkbox("button" + i, cg, i == 0);
                p.add(boxes[i]);
            }

            add(p, "North");
View Full Code Here


            Panel east_panel = new Panel();
            east_panel.setLayout(new GridLayout(0, 1));

            CheckboxGroup group = new CheckboxGroup();
            Checkbox cb = new Checkbox("one", group, true);
            east_panel.add(cb);
            cb = new Checkbox("two", group, false);
            east_panel.add(cb);

            add(east_panel, "East");

            final Button wb = new Button();
View Full Code Here

        add(b, BorderLayout.CENTER);
        b.setBackground(Color.YELLOW);

        final Button b2 = new Button("Left");
        final Scrollbar sb = new Scrollbar(Scrollbar.HORIZONTAL);
        final Checkbox cb1 = new Checkbox("Right");

        add(b2, BorderLayout.WEST);
        b2.setBackground(Color.RED);
        b2.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                System.out.println("Action on b2");
                if (sb.getValue() + sb.getBlockIncrement() <= sb.getMaximum()) {
                    sb.setValue(sb.getValue() + sb.getBlockIncrement());
                } else {
                    Frame f2 = new Frame("New frame");
                    f2.setSize(200, 100);
                    f2.setVisible(true);
                }
            }
        });

        add(cb1, BorderLayout.EAST);
        cb1.setBackground(Color.WHITE);

        final TextField tf = new TextField();
        tf.setText("Let's type here");
        add(tf, BorderLayout.SOUTH);
View Full Code Here

            Panel p = new Panel();
            p.setLayout(new GridLayout(3, 1));
            ((GridLayout) p.getLayout()).setHgap(5);
            ((GridLayout) p.getLayout()).setVgap(5);

            editable = new Checkbox("Editable", true);
            p.add(editable);
            editable.addItemListener(this);

            visible = new Checkbox("Visible", true);
            p.add(visible);
            visible.addItemListener(this);

            sensitive = new Checkbox("Sensitive", true);
            p.add(sensitive);
            sensitive.addItemListener(this);

            add(p, "Center");
View Full Code Here

   */
  public void test(TestHarness harness)
  {
    Robot r = harness.createRobot ();
    Frame frame = new Frame();
    Checkbox checkbox = new Checkbox("Checkbox");
    frame.add(checkbox);
    frame.setBounds(0, 0, 100, 100);
   
    harness.check(checkbox.getCheckboxGroup(), null);
    CheckboxGroup group = new CheckboxGroup();
    checkbox.setCheckboxGroup(group);
    harness.check(group, checkbox.getCheckboxGroup());
    frame.setVisible(true);
   
    r.waitForIdle ();
    r.delay(1000);
   
    checkbox.setCheckboxGroup(null);
   
    r.delay(1000);
   
    harness.check(checkbox.getCheckboxGroup(), null);
  }
View Full Code Here

   */
  public void test(TestHarness harness)
  {
    setBackground(Color.red);
    Frame f = new Frame();
    Checkbox c = new Checkbox("check!");
    c.setBackground(Color.blue);
    add(c);
    f.add(this);
    f.pack();
    f.show();
    Point loc = f.getLocationOnScreen();
    Rectangle bounds = c.getBounds();
    Insets i = f.getInsets();
    bounds.x += i.left + loc.x;
    bounds.y += i.top + loc.y;
   
    Robot r = harness.createRobot();
View Full Code Here

        tDestAlter = new TextField();

        tDestAlter.addActionListener(this);

        cTransfer = new Checkbox("Transfer to destination table", true);

        cTransfer.addItemListener(this);

        cDrop = new Checkbox("Drop destination table (ignore error)", true);

        cDrop.addItemListener(this);

        cCreate = new Checkbox("Create destination table", true);

        cCreate.addItemListener(this);

        cDropIndex = new Checkbox("Drop destination index (ignore error)",
                                  true);

        cDropIndex.addItemListener(this);

        cIdxForced = new Checkbox("force Idx_ prefix for indexes names",
                                  false);

        cIdxForced.addItemListener(this);

        cCreateIndex = new Checkbox("Create destination index", true);

        cCreateIndex.addItemListener(this);

        cDelete = new Checkbox("Delete rows in destination table", true);

        cDelete.addItemListener(this);

        cInsert = new Checkbox("Insert into destination", true);

        cInsert.addItemListener(this);

        cFKForced = new Checkbox("force FK_ prefix for foreign key names",
                                 false);

        cFKForced.addItemListener(this);

        cAlter = new Checkbox("Alter destination table", true);

        cAlter.addItemListener(this);
        p.add(createLabel("Source table"));
        p.add(tSourceTable);
        p.add(cTransfer);
View Full Code Here

        goalL = new Label(Messages.getString("MegaMek.goalL"), Label.RIGHT); //$NON-NLS-1$
        goalF = new TextField(Integer.toString(goalNumber), 2);
        goalL.setEnabled(register);
        goalF.setEnabled(register);

        registerC = new Checkbox(Messages.getString("MegaMek.registerC")); //$NON-NLS-1$
        register = false;
        registerC.setState(register);
        registerC.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent event) {
                boolean state = false;
View Full Code Here

        // Lay out this dialog.
        Panel tempPanel = new Panel();
        tempPanel.setLayout(new GridLayout(0, 1));

        // Add the setting controls.
        minimapEnabled = new Checkbox(Messages
                .getString("CommonSettingsDialog.minimapEnabled")); //$NON-NLS-1$
        tempPanel.add(minimapEnabled);

        autoEndFiring = new Checkbox(Messages
                .getString("CommonSettingsDialog.autoEndFiring")); //$NON-NLS-1$
        tempPanel.add(autoEndFiring);

        autoDeclareSearchlight = new Checkbox(Messages
                .getString("CommonSettingsDialog.autoDeclareSearchlight")); //$NON-NLS-1$
        tempPanel.add(autoDeclareSearchlight);

        nagForMASC = new Checkbox(Messages
                .getString("CommonSettingsDialog.nagForMASC")); //$NON-NLS-1$
        tempPanel.add(nagForMASC);

        mouseWheelZoom = new Checkbox(Messages
                .getString("CommonSettingsDialog.mouseWheelZoom")); //$NON-NLS-1$
        tempPanel.add(mouseWheelZoom);

        nagForPSR = new Checkbox(Messages
                .getString("CommonSettingsDialog.nagForPSR")); //$NON-NLS-1$
        tempPanel.add(nagForPSR);

        nagForNoAction = new Checkbox(Messages
                .getString("CommonSettingsDialog.nagForNoAction")); //$NON-NLS-1$
        tempPanel.add(nagForNoAction);

        animateMove = new Checkbox(Messages
                .getString("CommonSettingsDialog.animateMove")); //$NON-NLS-1$
        tempPanel.add(animateMove);

        showWrecks = new Checkbox(Messages
                .getString("CommonSettingsDialog.showWrecks")); //$NON-NLS-1$
        tempPanel.add(showWrecks);

        soundMute = new Checkbox(Messages
                .getString("CommonSettingsDialog.soundMute")); //$NON-NLS-1$
        tempPanel.add(soundMute);

        showMapHexPopup = new Checkbox(Messages
                .getString("CommonSettingsDialog.showMapHexPopup")); //$NON-NLS-1$
        tempPanel.add(showMapHexPopup);

        Panel panSetting;
        panSetting = new Panel(new FlowLayout(FlowLayout.LEFT));
        panSetting.add(new Label(Messages
                .getString("CommonSettingsDialog.tooltipDelay"))); //$NON-NLS-1$
        tooltipDelay = new TextField(4);
        panSetting.add(tooltipDelay);

        tempPanel.add(panSetting);

        panSetting = new Panel(new FlowLayout(FlowLayout.LEFT));
        unitStartChar = new Choice();
        // Add option for "A, B, C, D..."
        unitStartChar.addItem("\u0041, \u0042, \u0043, \u0044..."); //$NON-NLS-1$
        // Add option for "ALPHA, BETA, GAMMA, DELTA..."
        unitStartChar.addItem("\u0391, \u0392, \u0393, \u0394..."); //$NON-NLS-1$
        // Add option for "alpha, beta, gamma, delta..."
        unitStartChar.addItem("\u03B1, \u03B2, \u03B3, \u03B4..."); //$NON-NLS-1$
        panSetting.add(unitStartChar);
        panSetting.add(new Label(Messages
                .getString("CommonSettingsDialog.protoMechUnitCodes"))); //$NON-NLS-1$

        panSetting = new Panel(new FlowLayout(FlowLayout.LEFT));
        panSetting.add(new Label(Messages
                .getString("CommonSettingsDialog.pathFiderTimeLimit"))); //$NON-NLS-1$
        maxPathfinderTime = new TextField(5);
        panSetting.add(maxPathfinderTime);
        tempPanel.add(panSetting);

        getFocus = new Checkbox(Messages
                .getString("CommonSettingsDialog.getFocus")); //$NON-NLS-1$
        tempPanel.add(getFocus);
        tempPanel.add(panSetting);

        // player-specific settings
        defaultAutoejectDisabled = new Checkbox(Messages
                .getString("CommonSettingsDialog.defaultAutoejectDisabled")); //$NON-NLS-1$
        defaultAutoejectDisabled.addItemListener(this);
        tempPanel.add(defaultAutoejectDisabled);

        useAverageSkills = new Checkbox(Messages
                .getString("CommonSettingsDialog.useAverageSkills")); //$NON-NLS-1$
        useAverageSkills.addItemListener(this);
        tempPanel.add(useAverageSkills);

        showUnitId = new Checkbox(Messages
                .getString("CommonSettingsDialog.showUnitId")); //$NON-NLS-1$
        showUnitId.addItemListener(this);
        tempPanel.add(showUnitId);

        // client-side gameLog settings
        keepGameLog = new Checkbox(Messages
                .getString("CommonSettingsDialog.keepGameLog")); //$NON-NLS-1$
        keepGameLog.addItemListener(this);
        tempPanel.add(keepGameLog);

        panSetting = new Panel(new FlowLayout(FlowLayout.LEFT));
        panSetting.add(new Label(Messages
                .getString("CommonSettingsDialog.logFileName"))); //$NON-NLS-1$
        gameLogFilename = new TextField(15);
        panSetting.add(gameLogFilename);
        tempPanel.add(panSetting);

        panSetting = new Panel(new FlowLayout(FlowLayout.LEFT));
        panSetting.add(new Label(Messages
                .getString("CommonSettingsDialog.tileset"))); //$NON-NLS-1$
        tileSetChoice = new Choice();
        panSetting.add(tileSetChoice);
        tempPanel.add(panSetting);

        /*
         * panSetting = new Panel(new FlowLayout(FlowLayout.LEFT));
         * panSetting.add( new
         * Label(Messages.getString("CommonSettingsDialog.logFileMaxSize")) );
         * //$NON-NLS-1$ gameLogMaxSize = new TextField(5); panSetting.add(
         * gameLogMaxSize ); tempPanel.add( panSetting );
         */

        stampFilenames = new Checkbox(Messages
                .getString("CommonSettingsDialog.stampFilenames")); //$NON-NLS-1$
        stampFilenames.addItemListener(this);
        tempPanel.add(stampFilenames);

        panSetting = new Panel(new FlowLayout(FlowLayout.LEFT));
        panSetting.add(new Label(Messages
                .getString("CommonSettingsDialog.stampFormat"))); //$NON-NLS-1$
        stampFormat = new TextField(15);
        panSetting.add(stampFormat);
        tempPanel.add(panSetting);

        // scrolling options
        tempPanel.add(new AdvancedLabel(Messages
                .getString("CommonSettingsDialog.mapScrollText"))); //$NON-NLS-1$

        rightDragScroll = new Checkbox(Messages
                .getString("CommonSettingsDialog.rightDragScroll")); //$NON-NLS-1$
        tempPanel.add(rightDragScroll);

        ctlScroll = new Checkbox(Messages
                .getString("CommonSettingsDialog.ctlScroll")); //$NON-NLS-1$
        tempPanel.add(ctlScroll);

        clickEdgeScroll = new Checkbox(Messages
                .getString("CommonSettingsDialog.clickEdgeScroll")); //$NON-NLS-1$
        tempPanel.add(clickEdgeScroll);

        alwaysRightClickScroll = new Checkbox(Messages
                .getString("CommonSettingsDialog.alwaysRightClickScroll")); //$NON-NLS-1$
        tempPanel.add(alwaysRightClickScroll);

        autoEdgeScroll = new Checkbox(Messages
                .getString("CommonSettingsDialog.autoEdgeScroll")); //$NON-NLS-1$
        tempPanel.add(autoEdgeScroll);

        panSetting = new Panel(new FlowLayout(FlowLayout.LEFT));
        panSetting.add(new Label(Messages
                .getString("CommonSettingsDialog.scrollSesitivity"))); //$NON-NLS-1$
        scrollSensitivity = new TextField(4);
        panSetting.add(scrollSensitivity);
        tempPanel.add(panSetting);

        // locale settings
        panSetting = new Panel(new FlowLayout(FlowLayout.LEFT));
        panSetting.add(new Label(Messages
                .getString("CommonSettingsDialog.locale"))); //$NON-NLS-1$
        // locale = new TextField(8);
        locale = new Choice();
        locale.add(Messages.getString("CommonSettingsDialog.locale.English")); //$NON-NLS-1$
        locale.add(Messages.getString("CommonSettingsDialog.locale.Deutsch")); //$NON-NLS-1$
        locale.add(Messages.getString("CommonSettingsDialog.locale.Russian")); //$NON-NLS-1$
        panSetting.add(locale);
        tempPanel.add(panSetting);

        // chatloungtab setting
        chatloungeTabs = new Checkbox(Messages
                .getString("CommonSettingsDialog.chatloungeTabs")); //$NON-NLS-1$
        tempPanel.add(chatloungeTabs);

        // showMapsheets setting
        showMapsheets = new Checkbox(Messages
                .getString("CommonSettingsDialog.showMapsheets")); //$NON-NLS-1$
        tempPanel.add(showMapsheets);
        return tempPanel;
    }
View Full Code Here

                // Create a checkbox for the pod, and add it to the panel.
                StringBuffer message = new StringBuffer();
                message.append(entity.getLocationName(mount.getLocation()))
                        .append(" ") //$NON-NLS-1$
                        .append(mount.getName());
                Checkbox pod = new Checkbox(message.toString());
                panPods.add(pod);

                // Can the entity fire the pod?
                if (mount.canFire()) {
                    // Yup. Add a traker for this pod.
                    TriggerPodTracker tracker = new TriggerPodTracker(pod,
                            entity.getEquipmentNum(mount));
                    trackers.addElement(tracker);
                } else {
                    // Nope. Disable the checkbox.
                    pod.setEnabled(false);
                }

            } // End found-AP-Pod

        } // Look at the next piece of equipment.
View Full Code Here

TOP

Related Classes of java.awt.Checkbox$State

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.