Package java.awt

Examples of java.awt.Panel


        return l;
    }

    protected static Panel createBorderPanel(Component center) {

        Panel p = new Panel();

        p.setBackground(SystemColor.control);
        p.setLayout(new BorderLayout());
        p.add("Center", center);
        p.add("North", createLabel(""));
        p.add("South", createLabel(""));
        p.add("East", createLabel(""));
        p.add("West", createLabel(""));
        p.setBackground(SystemColor.control);

        return p;
    }
View Full Code Here


         addNotify();
         addWindowListener(new Close());
         setLayout(new BorderLayout());

         Panel p = new Panel(new GridLayout(3, 1));
         p.add(line1 = new Label());
         p.add(line2 = new Label());
         p.add(line3 = new Label());
         add("North", p);

         p = new Panel(new GridLayout(2, 1));
         p.add(new Label("Username:"));
         p.add(new Label("Password:"));
         add("West", p);
         p = new Panel(new GridLayout(2, 1));
         p.add(user = new TextField(30));
         p.add(pass = new TextField(30));
         pass.addActionListener(new Ok());
         pass.setEchoChar('*');
         add("East", p);

         GridBagLayout gb = new GridBagLayout();
         p = new Panel(gb);
         GridBagConstraints constr = new GridBagConstraints();
         Panel pp = new Panel();
         p.add(pp);
         constr.gridwidth = GridBagConstraints.REMAINDER;
         gb.setConstraints(pp, constr);
         constr.gridwidth = 1;
         constr.weightx = 1.0;
View Full Code Here

            m_pSouthParams.setLayout(new GridLayout(11, 1));
            m_pSouthParams.add(m_pListOptions);
            m_pSouthParams.add(m_pOpenAdvanced);

            Panel row1 = new Panel();
            row1.setLayout(new FlowLayout(FlowLayout.LEFT));
            row1.add(new Label(Messages
                    .getString("MechSelectorDialog.Search.Walk")));
            row1.add(m_cWalk);
            row1.add(m_tWalk);
            m_pSouthParams.add(row1);

            Panel row2 = new Panel();
            row2.setLayout(new FlowLayout(FlowLayout.LEFT));
            row2.add(new Label(Messages
                    .getString("MechSelectorDialog.Search.Jump")));
            row2.add(m_cJump);
            row2.add(m_tJump);
            m_pSouthParams.add(row2);

            Panel row3 = new Panel();
            row3.setLayout(new FlowLayout(FlowLayout.LEFT));
            row3.add(new Label(Messages
                    .getString("MechSelectorDialog.Search.Armor")));
            row3.add(m_cArmor);
            m_pSouthParams.add(row3);

            Panel row4 = new Panel();
            row4.setLayout(new FlowLayout(FlowLayout.LEFT));
            row4.add(new Label(Messages
                    .getString("MechSelectorDialog.Search.Weapons")));
            m_pSouthParams.add(row4);

            Panel row5 = new Panel();
            row5.setLayout(new FlowLayout(FlowLayout.LEFT));
            row5.add(new Label(Messages
                    .getString("MechSelectorDialog.Search.WeaponsAtLeast")));
            row5.add(m_tWeapons1);
            row5.add(m_cWeapons1);
            m_pSouthParams.add(row5);

            Panel row6 = new Panel();
            row6.setLayout(new FlowLayout(FlowLayout.LEFT));
            row6.add(m_cOrAnd);
            row6.add(new Label(Messages
                    .getString("MechSelectorDialog.Search.WeaponsAtLeast")));
            row6.add(m_tWeapons2);
            row6.add(m_cWeapons2);
            m_pSouthParams.add(row6);

            Panel row7 = new Panel();
            row7.setLayout(new FlowLayout(FlowLayout.LEFT));
            row7.add(new Label(Messages
                    .getString("MechSelectorDialog.Search.Equipment")));
            row7.add(m_chkEquipment);
            row7.add(m_cEquipment);
            m_pSouthParams.add(row7);

            Panel row8 = new Panel();
            row8.setLayout(new FlowLayout(FlowLayout.LEFT));
            row8.add(new Label(Messages
                    .getString("MechSelectorDialog.Search.Year")));
            row8.add(m_tStartYear);
            row8.add(new Label("-"));
            row8.add(m_tEndYear);
            m_pSouthParams.add(row8);

            Panel row9 = new Panel();
            row9.add(m_bSearch);
            row9.add(m_bReset);
            row9.add(m_lCount);
            m_pSouthParams.add(row9);
        } else {
            m_bToggleAdvanced.setLabel(Messages
                    .getString("MechSelectorDialog.Search.Show"));
            m_pOpenAdvanced.add(m_bToggleAdvanced);
View Full Code Here

        }
    }

    private void toggleAdvanced() {
        m_pUpper.remove(m_pSouthParams);
        m_pSouthParams = new Panel();
        if (GUIPreferences.getInstance().getMechSelectorShowAdvanced()) {
            buildSouthParams(false);
            GUIPreferences.getInstance().setMechSelectorShowAdvanced(false);
        } else {
            buildSouthParams(true);
View Full Code Here

        if (scroller != null) {
            return scroller;
        }

        // Place the board viewer in a set of scrollbars.
        scroller = new Panel();
        scroller.setLayout(new BorderLayout());
        vScrollbar = new Scrollbar(Scrollbar.VERTICAL);
        hScrollbar = new Scrollbar(Scrollbar.HORIZONTAL);
        scroller.add(this, BorderLayout.CENTER);
View Full Code Here

    public CommonSettingsDialog(Frame owner) {
        // Initialize our superclass with a title.
        super(owner, Messages.getString("CommonSettingsDialog.title")); //$NON-NLS-1$

        panTabs = new TabPanel();
        Panel settingsPanel = getSettingsPanel();
        scrolledPane.add(settingsPanel);
        panTabs.add("Main", scrolledPane);
        panTabs.add("Advanced", getAdvancedSettingsPanel());
        setLayout(new BorderLayout());
        this.add(panTabs, BorderLayout.CENTER);
        this.add(getButtonsPanel(), BorderLayout.SOUTH);

        // Close this dialog when the window manager says to.
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                cancel();
            }
        });

        // Center this dialog.
        pack();

        // Make the thing wide enough so a horizontal scrollbar isn't
        // necessary. I'm not sure why the extra hardcoded 10 pixels
        // is needed, maybe it's a ms windows thing.
        setLocationAndSize(settingsPanel.getPreferredSize().width
                + scrolledPane.getInsets().right + 10, settingsPanel
                .getPreferredSize().height);
    }
View Full Code Here

                .getPreferredSize().height);
    }

    private Panel getButtonsPanel() {
        // Add the dialog controls.
        Panel buttons = new Panel();
        buttons.setLayout(new GridLayout(1, 0, 20, 5));
        Button update = new Button(Messages
                .getString("CommonSettingsDialog.Update")); //$NON-NLS-1$
        update.setActionCommand(CommonSettingsDialog.UPDATE);
        update.addActionListener(this);
        buttons.add(update);
        Button cancel = new Button(Messages.getString("Cancel")); //$NON-NLS-1$
        cancel.setActionCommand(CommonSettingsDialog.CANCEL);
        cancel.addActionListener(this);
        buttons.add(cancel);

        return buttons;
    }
View Full Code Here

        return buttons;
    }

    private Panel getSettingsPanel() {
        // 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$
View Full Code Here

        GUIPreferences.getInstance().setValue(
                "Advanced" + keys.getItem(keysIndex), value.getText());
    }

    private Panel getAdvancedSettingsPanel() {
        Panel p = new Panel();

        keys = new List(10, false);
        String[] s = GUIPreferences.getInstance().getAdvancedProperties();
        Arrays.sort(s);
        for (int i = 0; i < s.length; i++) {
            keys.add(s[i]
                    .substring(s[i].indexOf("Advanced") + 8, s[i].length()));
        }
        keys.addItemListener(this);
        p.add(keys);

        value = new TextField(10);
        value.addFocusListener(this);
        p.add(value);

        return p;
    }
View Full Code Here

        // addBag(cb.getComponent(), gridbag, c);

        c.gridwidth = 1;
        c.weightx = 0.0;
        c.weighty = 0.0;
        Panel panButtons = new Panel();
        panButtons.setLayout(new GridLayout(1, 8));
        panButtons.add(rerollInitiativeB);
        for (int padding = 0; padding < 6; padding++) {
            panButtons.add(new Label("")); //$NON-NLS-1$
        }
        addBag(panButtons, gridbag, c);

        // c.weightx = 1.0; c.weighty = 0.0;
        // c.gridwidth = GridBagConstraints.REMAINDER;
View Full Code Here

TOP

Related Classes of java.awt.Panel

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.