Package org.jsurveylib.gui.swing.util

Examples of org.jsurveylib.gui.swing.util.Bag


    }

    void initAnswerPanel(JPanel answerPanel) {
        textField.setText(type.getAnswer());
        textField.addChangeListener(this);
        Bag bag = new Bag();
        answerPanel.add(textField, bag.WEST());
        answerPanel.add(validationLabel, bag.nextX().inset(0, SPACE_BEFORE_VALIDATION, 0, 0));
    }
View Full Code Here


    }

    void initAnswerPanel(JPanel answerPanel) {
        dropdown.setSelectedIndex(type.getSelectedIndex());
        dropdown.addActionListener(this);
        Bag bag = new Bag();
        answerPanel.add(dropdown, bag.WEST());
        answerPanel.add(validationLabel, bag.nextX().inset(0, SPACE_BEFORE_VALIDATION, 0, 0));
    }
View Full Code Here

    void initAnswerPanel(JPanel answerPanel) {
        ButtonGroup group = new ButtonGroup();
        int rows = type.isVertical() ? 0 : 1;
        int cols = type.isVertical() ? 1 : 0;

        Bag bag = new Bag();

        if (!type.getLeftLabel().equals("")) {
            JLabel label = new JLabel(type.getLeftLabel());
            label.setHorizontalAlignment(JLabel.CENTER);
            answerPanel.add(label, bag.WEST().inset(0, 0, 0, 12));
            bag.inset(0);
        }

        JPanel itemPane = new JPanel(new GridLayout(rows, cols, 6, 6));
        for (Choice choice : type.getChoices()) {
            JRadioButton button = new JRadioButton(choice.getLabel());
            button.setFont(SurveyPanel.FONT_QUESTION_ANSWER);
            button.addItemListener(this);
            button.putClientProperty("choice", choice);

            group.add(button);
            itemPane.add(button);

            radioButtons.add(button);
        }
        answerPanel.add(itemPane, bag.nextX());


        if (!type.getRightLabel().equals("")) {
            JLabel label = new JLabel(type.getRightLabel());
            label.setHorizontalAlignment(JLabel.CENTER);
            answerPanel.add(label, bag.nextX().inset(0, 12, 0, 0));
            bag.inset(0);
        }

        answerPanel.add(validationLabel, bag.nextX().inset(0, SPACE_BEFORE_VALIDATION, 0, 0));
        updateRenderer();
    }
View Full Code Here

    }

    void initAnswerPanel(JPanel answerPanel) {
        checkbox.setSelected(type.isChecked());

        Bag bag = new Bag();
        answerPanel.add(checkbox, bag);
        answerPanel.add(validationLabel, bag.nextX().WEST().inset(0, SPACE_BEFORE_VALIDATION, 0, 0));

        checkbox.addActionListener(this);
    }
View Full Code Here

        browseButton = new JButton(browseString);
    }

    void initAnswerPanel(JPanel answerPanel) {

        Bag bag = new Bag();

        pathField.setText(type.getAnswer());
        answerPanel.add(pathField, bag.WEST().inset(0, 0, 0, 2));
        pathField.addChangeListener(this);

        answerPanel.add(browseButton, bag.nextX().inset(0));
        browseButton.addActionListener(this);

        answerPanel.add(validationLabel, bag.nextX().inset(0, SPACE_BEFORE_VALIDATION, 0, 0));
    }
View Full Code Here

    void initAnswerPanel(JPanel answerPanel) {
        textArea.setText(type.getAnswer());
        textArea.addChangeListener(this);

        Bag bag = new Bag();
        answerPanel.add(jscrollPane, bag.WEST());
        answerPanel.add(validationLabel, bag.nextX().inset(0, SPACE_BEFORE_VALIDATION, 0, 0));

    }
View Full Code Here

TOP

Related Classes of org.jsurveylib.gui.swing.util.Bag

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.