javax.swing.JPanel

Here are the examples of the java api class javax.swing.JPanel taken from open source projects.

1. COutdegreeCriteriumPanel#initPanel()

Project: binnavi
File: COutdegreeCriteriumPanel.java
/**
   * Creates the GUI of the panel.
   */
private void initPanel() {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(new TitledBorder("Edit Outdegree Condition"));
    final JPanel operatorPanel = new JPanel(new BorderLayout());
    operatorPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    final JPanel inputPanel = new JPanel(new BorderLayout());
    inputPanel.setBorder(new EmptyBorder(5, 0, 5, 5));
    operatorPanel.add(m_operatorBox, BorderLayout.CENTER);
    inputPanel.add(m_inputField, BorderLayout.CENTER);
    final JPanel containerPanel = new JPanel(new BorderLayout());
    containerPanel.add(operatorPanel, BorderLayout.WEST);
    containerPanel.add(inputPanel, BorderLayout.CENTER);
    mainPanel.add(containerPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}

2. CIndegreeCriteriumPanel#initPanel()

Project: binnavi
File: CIndegreeCriteriumPanel.java
/**
   * Creates the GUI of the panel.
   */
private void initPanel() {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(new TitledBorder("Edit Indegree Condition"));
    final JPanel operatorPanel = new JPanel(new BorderLayout());
    operatorPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    operatorPanel.add(m_operatorBox, BorderLayout.CENTER);
    final JPanel inputPanel = new JPanel(new BorderLayout());
    inputPanel.setBorder(new EmptyBorder(5, 0, 5, 5));
    inputPanel.add(m_inputField, BorderLayout.CENTER);
    final JPanel containerPanel = new JPanel(new BorderLayout());
    containerPanel.add(operatorPanel, BorderLayout.WEST);
    containerPanel.add(inputPanel, BorderLayout.CENTER);
    mainPanel.add(containerPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}

3. AbstractFormDialog#initView()

Project: zaproxy
File: AbstractFormDialog.java
protected void initView() {
    JPanel buttonsPanel = new JPanel();
    buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.LINE_AXIS));
    buttonsPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    buttonsPanel.add(getHelpButton());
    buttonsPanel.add(Box.createHorizontalGlue());
    buttonsPanel.add(getCancelButton());
    buttonsPanel.add(Box.createRigidArea(new Dimension(5, 0)));
    buttonsPanel.add(getConfirmButton());
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(getFieldsPanel(), BorderLayout.CENTER);
    panel.add(buttonsPanel, BorderLayout.PAGE_END);
    this.setContentPane(panel);
}

4. EditUserDialog#initialize()

Project: gitblit
File: EditUserDialog.java
private void initialize(int protocolVersion, UserModel anUser) {
    usernameField = new JTextField(anUser.username == null ? "" : anUser.username, 25);
    passwordField = new JPasswordField(anUser.password == null ? "" : anUser.password, 25);
    confirmPasswordField = new JPasswordField(anUser.password == null ? "" : anUser.password, 25);
    displayNameField = new JTextField(anUser.displayName == null ? "" : anUser.displayName, 25);
    emailAddressField = new JTextField(anUser.emailAddress == null ? "" : anUser.emailAddress, 25);
    canAdminCheckbox = new JCheckBox(Translation.get("gb.canAdminDescription"), anUser.canAdmin);
    canForkCheckbox = new JCheckBox(Translation.get("gb.canForkDescription"), anUser.canFork);
    canCreateCheckbox = new JCheckBox(Translation.get("gb.canCreateDescription"), anUser.canCreate);
    notFederatedCheckbox = new JCheckBox(Translation.get("gb.excludeFromFederationDescription"), anUser.excludeFromFederation);
    disabledCheckbox = new JCheckBox(Translation.get("gb.disableUserDescription"), anUser.disabled);
    organizationalUnitField = new JTextField(anUser.organizationalUnit == null ? "" : anUser.organizationalUnit, 25);
    organizationField = new JTextField(anUser.organization == null ? "" : anUser.organization, 25);
    localityField = new JTextField(anUser.locality == null ? "" : anUser.locality, 25);
    stateProvinceField = new JTextField(anUser.stateProvince == null ? "" : anUser.stateProvince, 25);
    countryCodeField = new JTextField(anUser.countryCode == null ? "" : anUser.countryCode, 15);
    // credentials are optionally controlled by 3rd-party authentication
    usernameField.setEnabled(anUser.isLocalAccount());
    passwordField.setEnabled(anUser.isLocalAccount());
    confirmPasswordField.setEnabled(anUser.isLocalAccount());
    JPanel fieldsPanel = new JPanel(new GridLayout(0, 1));
    fieldsPanel.add(newFieldPanel(Translation.get("gb.username"), usernameField));
    fieldsPanel.add(newFieldPanel(Translation.get("gb.password"), passwordField));
    fieldsPanel.add(newFieldPanel(Translation.get("gb.confirmPassword"), confirmPasswordField));
    fieldsPanel.add(newFieldPanel(Translation.get("gb.displayName"), displayNameField));
    fieldsPanel.add(newFieldPanel(Translation.get("gb.emailAddress"), emailAddressField));
    fieldsPanel.add(newFieldPanel(Translation.get("gb.canAdmin"), canAdminCheckbox));
    fieldsPanel.add(newFieldPanel(Translation.get("gb.canFork"), canForkCheckbox));
    fieldsPanel.add(newFieldPanel(Translation.get("gb.canCreate"), canCreateCheckbox));
    fieldsPanel.add(newFieldPanel(Translation.get("gb.excludeFromFederation"), notFederatedCheckbox));
    fieldsPanel.add(newFieldPanel(Translation.get("gb.disableUser"), disabledCheckbox));
    JPanel attributesPanel = new JPanel(new GridLayout(0, 1, 5, 2));
    attributesPanel.add(newFieldPanel(Translation.get("gb.organizationalUnit") + " (OU)", organizationalUnitField));
    attributesPanel.add(newFieldPanel(Translation.get("gb.organization") + " (O)", organizationField));
    attributesPanel.add(newFieldPanel(Translation.get("gb.locality") + " (L)", localityField));
    attributesPanel.add(newFieldPanel(Translation.get("gb.stateProvince") + " (ST)", stateProvinceField));
    attributesPanel.add(newFieldPanel(Translation.get("gb.countryCode") + " (C)", countryCodeField));
    final Insets _insets = new Insets(5, 5, 5, 5);
    repositoryPalette = new RegistrantPermissionsPanel(RegistrantType.REPOSITORY);
    teamsPalette = new JPalette<TeamModel>();
    JPanel fieldsPanelTop = new JPanel(new BorderLayout());
    fieldsPanelTop.add(fieldsPanel, BorderLayout.NORTH);
    JPanel attributesPanelTop = new JPanel(new BorderLayout());
    attributesPanelTop.add(attributesPanel, BorderLayout.NORTH);
    JPanel repositoriesPanel = new JPanel(new BorderLayout()) {

        private static final long serialVersionUID = 1L;

        @Override
        public Insets getInsets() {
            return _insets;
        }
    };
    repositoriesPanel.add(repositoryPalette, BorderLayout.CENTER);
    JPanel teamsPanel = new JPanel(new BorderLayout()) {

        private static final long serialVersionUID = 1L;

        @Override
        public Insets getInsets() {
            return _insets;
        }
    };
    teamsPanel.add(teamsPalette, BorderLayout.CENTER);
    JTabbedPane panel = new JTabbedPane(JTabbedPane.TOP);
    panel.addTab(Translation.get("gb.general"), fieldsPanelTop);
    panel.addTab(Translation.get("gb.attributes"), attributesPanelTop);
    if (protocolVersion > 1) {
        panel.addTab(Translation.get("gb.teamMemberships"), teamsPanel);
    }
    panel.addTab(Translation.get("gb.restrictedRepositories"), repositoriesPanel);
    JButton createButton = new JButton(Translation.get("gb.save"));
    createButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent event) {
            if (validateFields()) {
                canceled = false;
                setVisible(false);
            }
        }
    });
    JButton cancelButton = new JButton(Translation.get("gb.cancel"));
    cancelButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent event) {
            canceled = true;
            setVisible(false);
        }
    });
    JPanel controls = new JPanel();
    controls.add(cancelButton);
    controls.add(createButton);
    JPanel centerPanel = new JPanel(new BorderLayout(5, 5)) {

        private static final long serialVersionUID = 1L;

        @Override
        public Insets getInsets() {
            return _insets;
        }
    };
    centerPanel.add(panel, BorderLayout.CENTER);
    centerPanel.add(controls, BorderLayout.SOUTH);
    getContentPane().setLayout(new BorderLayout(5, 5));
    getContentPane().add(centerPanel, BorderLayout.CENTER);
    pack();
}

5. CTextCriteriumPanel#initPanel()

Project: binnavi
File: CTextCriteriumPanel.java
/**
   * Creates the panel GUI.
   */
private void initPanel() {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(new TitledBorder("Edit Text Condition"));
    final JPanel inputPanel = new JPanel(new BorderLayout());
    inputPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    m_inputField.setPreferredSize(new Dimension(m_inputField.getPreferredSize().width, 23));
    inputPanel.add(m_inputField, BorderLayout.NORTH);
    final JPanel checkboxesPanel = new JPanel(new GridLayout(2, 1));
    checkboxesPanel.setBorder(new EmptyBorder(5, 0, 0, 0));
    checkboxesPanel.add(m_caseSensitiveBox);
    checkboxesPanel.add(m_regExBox);
    inputPanel.add(checkboxesPanel, BorderLayout.CENTER);
    mainPanel.add(inputPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}

6. MainMenuPanel#createStructure()

Project: settlers-remake
File: MainMenuPanel.java
private void createStructure() {
    JPanel westPanel = new JPanel();
    westPanel.setLayout(new GridLayout(0, 1, 20, 20));
    westPanel.add(newSinglePlayerGameButton);
    westPanel.add(loadSaveGameButton);
    westPanel.add(settingsButton);
    westPanel.add(newNetworkGameButton);
    westPanel.add(joinNetworkGameButton);
    westPanel.add(exitButton);
    add(westPanel);
    buttonGroup.add(newSinglePlayerGameButton);
    buttonGroup.add(loadSaveGameButton);
    buttonGroup.add(settingsButton);
    buttonGroup.add(newNetworkGameButton);
    buttonGroup.add(joinNetworkGameButton);
    add(emptyPanel);
    getTitleLabel().setVisible(false);
    westPanel.setPreferredSize(PREFERRED_WEST_PANEL_SIZE);
}

7. ReqBodyPanelUrlStream#init()

Project: rest-client
File: ReqBodyPanelUrlStream.java
@PostConstruct
protected void init() {
    setLayout(new FlowLayout(FlowLayout.LEFT));
    jtf_url.setToolTipText("Contents of this URL will be set as request body");
    JPanel jp = new JPanel(new BorderLayout());
    JPanel jp_west = new JPanel(new GridLayout(2, 1));
    jp_west.add(new JLabel(" Content type: "));
    jp_west.add(new JLabel(" URL: "));
    jp.add(jp_west, BorderLayout.WEST);
    JPanel jp_center = new JPanel(new GridLayout(2, 1));
    jp_center.add(jp_content_type_charset.getComponent());
    jp_center.add(UIUtil.getFlowLayoutPanelLeftAligned(jtf_url));
    jp.add(jp_center, BorderLayout.CENTER);
    add(jp);
}

8. BenchmarkAggregatorFrame#createBenchmarkTreePanel()

Project: optaplanner
File: BenchmarkAggregatorFrame.java
private JComponent createBenchmarkTreePanel() {
    JPanel benchmarkTreePanel = new JPanel(new BorderLayout());
    benchmarkTreePanel.add(new JScrollPane(plannerBenchmarkResultList.isEmpty() ? createNoPlannerFoundTextField() : createCheckBoxTree(), JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.CENTER);
    JPanel buttonPanelWrapper = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    JPanel buttonPanel = new JPanel(new GridLayout(1, 2, 10, 0));
    generateReportButton = new JButton(new GenerateReportAction(this));
    generateReportButton.setEnabled(false);
    buttonPanel.add(generateReportButton);
    generateProgressBar = new JProgressBar();
    buttonPanel.add(generateProgressBar);
    buttonPanelWrapper.add(buttonPanel);
    benchmarkTreePanel.add(buttonPanelWrapper, BorderLayout.SOUTH);
    benchmarkTreePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 15, 0));
    return benchmarkTreePanel;
}

9. CGeneralSettingsPanel#createEditElementsPanel()

Project: binnavi
File: CGeneralSettingsPanel.java
/**
   * Creates the panels shown in the settings panel.
   *
   * @return The panel created by this function.
   */
private JPanel createEditElementsPanel() {
    final JPanel pEdits = new JPanel(new GridLayout(6, 1, 4, 4));
    pEdits.setBorder(new TitledBorder("General Settings"));
    // IDA Pro selection
    final JPanel idaLocationPanel = new JPanel(new BorderLayout());
    idaLocationPanel.setBorder(new EmptyBorder(0, 2, 0, 2));
    final JLabel idaLabel = new JLabel("IDA Pro Installation Directory:");
    idaLabel.setBorder(new EmptyBorder(0, 0, 0, 10));
    idaLocationPanel.add(idaLabel, BorderLayout.CENTER);
    idaLocationPanel.add(CHintCreator.createHintPanel(idaDirectoryPanel, "The location of your IDA installation."), BorderLayout.EAST);
    pEdits.add(idaLocationPanel);
    // Support Email
    final JPanel emailBoxPanel = new JPanel(new BorderLayout());
    emailBoxPanel.setBorder(new EmptyBorder(0, 2, 2, 2));
    final JLabel emailLabel = new JLabel("Your email address" + ":");
    emailBoxPanel.add(emailLabel, BorderLayout.CENTER);
    emailBoxPanel.add(CHintCreator.createHintPanel(emailBox, "This email address is used to contact you after you have submitted bugs."), BorderLayout.EAST);
    pEdits.add(emailBoxPanel, BorderLayout.CENTER);
    emailBox.setText(ConfigManager.instance().getGeneralSettings().getSupportEmailAddress());
    // Scripting language
    final JPanel scriptingPanel = new JPanel(new BorderLayout());
    scriptingPanel.setBorder(new EmptyBorder(0, 2, 2, 2));
    final JLabel scriptingLabel = new JLabel("Default Scripting Language" + ":");
    scriptingPanel.add(scriptingLabel, BorderLayout.CENTER);
    scriptingPanel.add(CHintCreator.createHintPanel(scriptingBox, "Scripting language that is selected by default when opening scripting dialogs."), BorderLayout.EAST);
    pEdits.add(scriptingPanel, BorderLayout.CENTER);
    scriptingBox.setSelectedLanguage(ConfigManager.instance().getGeneralSettings().getDefaultScriptingLanguage());
    // Log level
    final JPanel logLevelPanel = new JPanel(new BorderLayout());
    logLevelPanel.setBorder(new EmptyBorder(0, 2, 2, 2));
    final JLabel logLevelLabel = new JLabel("Log Level" + ":");
    logLevelPanel.add(logLevelLabel, BorderLayout.CENTER);
    logLevelPanel.add(CHintCreator.createHintPanel(logLevelBox, "Determines what messages are logged to the log file."), BorderLayout.EAST);
    pEdits.add(logLevelPanel, BorderLayout.CENTER);
    logLevelBox.setSelectedIndex(ConfigManager.instance().getGeneralSettings().getLogLevel());
    // Log file
    final JPanel logFilePanel = new JPanel(new BorderLayout());
    logFilePanel.setBorder(new EmptyBorder(0, 2, 2, 2));
    final JLabel logFileLabel = new JLabel("Log File" + ":");
    final JPanel fileLabel = new CLogFilePanel();
    fileLabel.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT));
    logFilePanel.add(logFileLabel, BorderLayout.CENTER);
    logFilePanel.add(CHintCreator.createHintPanel(fileLabel, "Location of the BinNavi log file."), BorderLayout.EAST);
    pEdits.add(logFilePanel, BorderLayout.CENTER);
    return pEdits;
}

10. PreviewPanel#createImagesCard()

Project: jpexs-decompiler
File: PreviewPanel.java
private JPanel createImagesCard() {
    JPanel shapesCard = new JPanel(new BorderLayout());
    JPanel previewPanel = new JPanel(new BorderLayout());
    JPanel previewCnt = new JPanel(new BorderLayout());
    imagePanel = new ImagePanel();
    imagePanel.setLoop(Configuration.loopMedia.get());
    previewCnt.add(imagePanel, BorderLayout.CENTER);
    previewCnt.add(imagePlayControls = new PlayerControls(mainPanel, imagePanel), BorderLayout.SOUTH);
    imagePlayControls.setMedia(imagePanel);
    previewPanel.add(previewCnt, BorderLayout.CENTER);
    JLabel prevIntLabel = new HeaderLabel(mainPanel.translate("swfpreview.internal"));
    prevIntLabel.setHorizontalAlignment(SwingConstants.CENTER);
    //prevIntLabel.setBorder(new BevelBorder(BevelBorder.RAISED));
    previewPanel.add(prevIntLabel, BorderLayout.NORTH);
    shapesCard.add(previewPanel, BorderLayout.CENTER);
    shapesCard.add(createImageButtonsPanel(), BorderLayout.SOUTH);
    return shapesCard;
}

11. InternalFrameDemo#createInternalFramePalette()

Project: beautyeye
File: InternalFrameDemo.java
/**
     * Creates the internal frame palette.
     *
     * @return the j internal frame
     */
public JInternalFrame createInternalFramePalette() {
    JInternalFrame palette = new JInternalFrame(getString("InternalFrameDemo.palette_label"));
    //beautyEye_study??????????(JInternalFrame.isPalett????MetalLookAndFeel????)
    palette.putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);
    palette.getContentPane().setLayout(new BorderLayout());
    palette.setBounds(PALETTE_X, PALETTE_Y, PALETTE_WIDTH, PALETTE_HEIGHT);
    palette.setResizable(true);
    palette.setIconifiable(true);
    desktop.add(palette, PALETTE_LAYER);
    // *************************************
    // * Create create frame maker buttons *
    // *************************************
    JButton b1 = new JButton(smIcon1);
    b1.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.lightBlue));
    b1.setForeground(Color.white);
    JButton b2 = new JButton(smIcon2);
    JButton b3 = new JButton(smIcon3);
    JButton b4 = new JButton(smIcon4);
    b4.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.green));
    b4.setForeground(Color.white);
    // add frame maker actions
    b1.addActionListener(new ShowFrameAction(this, icon1));
    b2.addActionListener(new ShowFrameAction(this, icon2));
    b3.addActionListener(new ShowFrameAction(this, icon3));
    b4.addActionListener(new ShowFrameAction(this, icon4));
    // add frame maker buttons to panel
    JPanel p = new JPanel();
    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
    JPanel buttons1 = new JPanel();
    buttons1.setLayout(new BoxLayout(buttons1, BoxLayout.X_AXIS));
    JPanel buttons2 = new JPanel();
    buttons2.setLayout(new BoxLayout(buttons2, BoxLayout.X_AXIS));
    buttons1.add(b1);
    buttons1.add(Box.createRigidArea(HGAP15));
    buttons1.add(b2);
    buttons2.add(b3);
    buttons2.add(Box.createRigidArea(HGAP15));
    buttons2.add(b4);
    p.add(Box.createRigidArea(VGAP10));
    p.add(buttons1);
    p.add(Box.createRigidArea(VGAP15));
    p.add(buttons2);
    p.add(Box.createRigidArea(VGAP10));
    palette.getContentPane().add(p, BorderLayout.NORTH);
    // ************************************
    // * Create frame property checkboxes *
    // ************************************
    p = new JPanel() {

        Insets insets = new Insets(10, 15, 10, 5);

        public Insets getInsets() {
            return insets;
        }
    };
    p.setLayout(new GridLayout(1, 2));
    Box box = new Box(BoxLayout.Y_AXIS);
    windowResizable = new JCheckBox(getString("InternalFrameDemo.resizable_label"), true);
    windowIconifiable = new JCheckBox(getString("InternalFrameDemo.iconifiable_label"), true);
    box.add(Box.createGlue());
    box.add(windowResizable);
    box.add(windowIconifiable);
    box.add(Box.createGlue());
    p.add(box);
    box = new Box(BoxLayout.Y_AXIS);
    windowClosable = new JCheckBox(getString("InternalFrameDemo.closable_label"), true);
    windowMaximizable = new JCheckBox(getString("InternalFrameDemo.maximizable_label"), true);
    box.add(Box.createGlue());
    box.add(windowClosable);
    box.add(windowMaximizable);
    box.add(Box.createGlue());
    p.add(box);
    palette.getContentPane().add(p, BorderLayout.CENTER);
    // ************************************
    // *   Create Frame title textfield   *
    // ************************************
    p = new JPanel() {

        Insets insets = new Insets(0, 0, 10, 0);

        public Insets getInsets() {
            return insets;
        }
    };
    windowTitleField = new JTextField(getString("InternalFrameDemo.frame_label"));
    windowTitleLabel = new JLabel(getString("InternalFrameDemo.title_text_field_label"));
    p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
    p.add(Box.createRigidArea(HGAP5));
    p.add(windowTitleLabel, BorderLayout.WEST);
    p.add(Box.createRigidArea(HGAP5));
    p.add(windowTitleField, BorderLayout.CENTER);
    p.add(Box.createRigidArea(HGAP5));
    palette.getContentPane().add(p, BorderLayout.SOUTH);
    palette.show();
    return palette;
}

12. MetalworksDocumentFrame#buildAddressPanel()

Project: jdk7u-jdk
File: MetalworksDocumentFrame.java
private JPanel buildAddressPanel() {
    JPanel p = new JPanel();
    p.setLayout(new LabeledPairLayout());
    JLabel toLabel = new JLabel("To: ", JLabel.RIGHT);
    JTextField toField = new JTextField(25);
    p.add(toLabel, "label");
    p.add(toField, "field");
    JLabel subLabel = new JLabel("Subj: ", JLabel.RIGHT);
    JTextField subField = new JTextField(25);
    p.add(subLabel, "label");
    p.add(subField, "field");
    JLabel ccLabel = new JLabel("cc: ", JLabel.RIGHT);
    JTextField ccField = new JTextField(25);
    p.add(ccLabel, "label");
    p.add(ccField, "field");
    return p;
}

13. OptaPlannerExamplesApp#createRealExamplesPanel()

Project: optaplanner
File: OptaPlannerExamplesApp.java
private JPanel createRealExamplesPanel() {
    JPanel panel = new JPanel(new GridLayout(0, 1, 5, 5));
    TitledBorder titledBorder = BorderFactory.createTitledBorder("Real examples");
    titledBorder.setTitleColor(TangoColorFactory.BUTTER_3);
    panel.setBorder(BorderFactory.createCompoundBorder(titledBorder, BorderFactory.createEmptyBorder(5, 5, 5, 5)));
    panel.add(createExampleButton(new CurriculumCourseApp()));
    panel.add(createExampleButton(new MachineReassignmentApp()));
    panel.add(createExampleButton(new VehicleRoutingApp()));
    panel.add(createExampleButton(new ProjectJobSchedulingApp()));
    panel.add(createExampleButton(new PatientAdmissionScheduleApp()));
    panel.add(createExampleButton(new TaskAssigningApp()));
    return panel;
}

14. OptaPlannerExamplesApp#createBasicExamplesPanel()

Project: optaplanner
File: OptaPlannerExamplesApp.java
private JPanel createBasicExamplesPanel() {
    JPanel panel = new JPanel(new GridLayout(0, 1, 5, 5));
    TitledBorder titledBorder = BorderFactory.createTitledBorder("Basic examples");
    titledBorder.setTitleColor(TangoColorFactory.CHAMELEON_3);
    panel.setBorder(BorderFactory.createCompoundBorder(titledBorder, BorderFactory.createEmptyBorder(5, 5, 5, 5)));
    panel.add(createExampleButton(new NQueensApp()));
    panel.add(createExampleButton(new CloudBalancingApp()));
    panel.add(createExampleButton(new TspApp()));
    panel.add(createExampleButton(new DinnerPartyApp()));
    panel.add(createExampleButton(new TennisApp()));
    panel.add(createExampleButton(new MeetingSchedulingApp()));
    return panel;
}

15. OptaPlannerExamplesApp#createContentPane()

Project: optaplanner
File: OptaPlannerExamplesApp.java
private Container createContentPane() {
    JPanel contentPane = new JPanel(new BorderLayout(5, 5));
    contentPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    JLabel titleLabel = new JLabel("Which example do you want to see?", JLabel.CENTER);
    titleLabel.setFont(titleLabel.getFont().deriveFont(20.0f));
    contentPane.add(titleLabel, BorderLayout.NORTH);
    JScrollPane examplesScrollPane = new JScrollPane(createExamplesPanel());
    examplesScrollPane.getHorizontalScrollBar().setUnitIncrement(20);
    examplesScrollPane.getVerticalScrollBar().setUnitIncrement(20);
    contentPane.add(examplesScrollPane, BorderLayout.CENTER);
    JPanel bottomPanel = new JPanel(new BorderLayout(5, 5));
    bottomPanel.add(createDescriptionPanel(), BorderLayout.CENTER);
    bottomPanel.add(createExtraPanel(), BorderLayout.EAST);
    contentPane.add(bottomPanel, BorderLayout.SOUTH);
    return contentPane;
}

16. MetalworksDocumentFrame#buildAddressPanel()

Project: openjdk
File: MetalworksDocumentFrame.java
private JPanel buildAddressPanel() {
    JPanel p = new JPanel();
    p.setLayout(new LabeledPairLayout());
    JLabel toLabel = new JLabel("To: ", JLabel.RIGHT);
    JTextField toField = new JTextField(25);
    p.add(toLabel, "label");
    p.add(toField, "field");
    JLabel subLabel = new JLabel("Subj: ", JLabel.RIGHT);
    JTextField subField = new JTextField(25);
    p.add(subLabel, "label");
    p.add(subField, "field");
    JLabel ccLabel = new JLabel("cc: ", JLabel.RIGHT);
    JTextField ccField = new JTextField(25);
    p.add(ccLabel, "label");
    p.add(ccField, "field");
    return p;
}

17. AutoCoverDemo#main()

Project: libresonic
File: AutoCoverDemo.java
public static void main(String[] args) throws IOException {
    JFrame frame = new JFrame();
    JPanel panel = new JPanel();
    panel.add(new AlbumComponent(110, 110));
    panel.add(new AlbumComponent(150, 150));
    panel.add(new AlbumComponent(200, 200));
    panel.add(new AlbumComponent(300, 300));
    panel.add(new AlbumComponent(400, 240));
    panel.add(new AlbumComponent(240, 400));
    panel.setBackground(Color.LIGHT_GRAY);
    frame.add(panel);
    frame.setSize(1000, 800);
    frame.setVisible(true);
}

18. NestedWorkflowCreationDialog#createIncludedProcessorsPanel()

Project: incubator-taverna-plugin-component
File: NestedWorkflowCreationDialog.java
private JPanel createIncludedProcessorsPanel() {
    JPanel result = new JPanel();
    result.setLayout(new BorderLayout());
    result.add(new JLabel("Included services"), NORTH);
    includedList.setModel(new DefaultComboBoxModel<>(new Vector<>(includedProcessors)));
    includedList.setCellRenderer(processorRenderer);
    result.add(new JScrollPane(includedList), CENTER);
    excludeButton = new DeselectingButton("Exclude", new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            includedProcessors.removeAll(includedList.getSelectedValuesList());
            calculateIncludableProcessors();
            updateLists();
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout());
    buttonPanel.add(excludeButton);
    result.add(buttonPanel, SOUTH);
    return result;
}

19. NestedWorkflowCreationDialog#createIncludableProcessorsPanel()

Project: incubator-taverna-plugin-component
File: NestedWorkflowCreationDialog.java
private JPanel createIncludableProcessorsPanel() {
    JPanel result = new JPanel();
    result.setLayout(new BorderLayout());
    result.add(new JLabel("Possible services"), NORTH);
    includableList.setModel(new DefaultComboBoxModel<>(new Vector<>(includableProcessors)));
    includableList.setCellRenderer(processorRenderer);
    result.add(new JScrollPane(includableList), CENTER);
    includeButton = new DeselectingButton("Include", new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            includedProcessors.addAll(includableList.getSelectedValuesList());
            calculateIncludableProcessors();
            updateLists();
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout());
    buttonPanel.add(includeButton);
    result.add(buttonPanel, SOUTH);
    return result;
}

20. TableGui#addTableViewEditPane()

Project: h-store
File: TableGui.java
private void addTableViewEditPane() {
    JPanel paneTableDisplayAndEdit = new JPanel();
    paneTableDisplayAndEdit.setLayout(null);
    int nWidth = m_paneParent.getWidth();
    int nHeight = m_paneParent.getHeight() - m_paneTblBt.getHeight() - 3 * GuiConstants.GAP_COMPONENT;
    paneTableDisplayAndEdit.setBounds(0, m_paneTblBt.getHeight(), nWidth, nHeight);
    add(paneTableDisplayAndEdit);
    // paneTableDisplayAndEdit.setBorder(BorderFactory.createLineBorder(Color.red));
    m_scrollTblName = new LHSListPane(paneTableDisplayAndEdit, m_lstTblName);
    paneTableDisplayAndEdit.add(m_scrollTblName);
    paneTableDisplayAndEdit.add(createTableCSVArea());
    paneTableDisplayAndEdit.add(createTableCardinalityArea());
    paneTableDisplayAndEdit.add(createColumnViewArea());
    paneTableDisplayAndEdit.add(createColumnEditArea());
    disableTableOptions();
}

21. GenerateOptionPanel#createButtonPanel()

Project: umlet
File: GenerateOptionPanel.java
private JPanel createButtonPanel() {
    CancelOkListener listener = new CancelOkListener();
    JButton button_ok = new JButton(okButton);
    button_ok.setActionCommand(okButton);
    button_ok.addActionListener(listener);
    JButton button_cancel = new JButton(cancelButton);
    button_cancel.setActionCommand(cancelButton);
    button_cancel.addActionListener(listener);
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
    buttonPanel.add(Box.createHorizontalGlue());
    buttonPanel.add(button_cancel);
    buttonPanel.add(Box.createRigidArea(new Dimension(20, 0)));
    buttonPanel.add(button_ok);
    buttonPanel.add(Box.createHorizontalGlue());
    buttonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
    return buttonPanel;
}

22. GenerateOptionPanel#createOptionPanel()

Project: umlet
File: GenerateOptionPanel.java
private JPanel createOptionPanel() {
    JPanel optionPanel = new JPanel();
    optionPanel.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    packageInfo = new JCheckBox("Show package");
    packageInfo.setSelected(true);
    optionPanel.add(packageInfo, layout(c, 0, 0));
    fields = createButtonGroup(FieldOptions.values());
    optionPanel.add(createSubPanel("Show fields", fields), layout(c, 0, 1));
    methods = createButtonGroup(MethodOptions.values());
    optionPanel.add(createSubPanel("Show methods", methods), layout(c, 1, 1));
    signatures = createButtonGroup(SignatureOptions.values());
    optionPanel.add(createSubPanel("Show signatures", signatures), layout(c, 0, 2));
    sortings = createButtonGroup(SortOptions.values());
    optionPanel.add(createSubPanel("Sorting", sortings), layout(c, 1, 2));
    optionPanel.validate();
    return optionPanel;
}

23. SettingsMenuPanel#createStructure()

Project: settlers-remake
File: SettingsMenuPanel.java
private void createStructure() {
    JPanel panel = new JPanel();
    panel.setLayout(new GridLayout(0, 2, 20, 20));
    panel.add(playerNameLabel);
    playerNameField.putClientProperty(ELFStyle.KEY, ELFStyle.TEXT_DEFAULT);
    SwingUtilities.updateComponentTreeUI(playerNameField);
    panel.add(playerNameField);
    panel.add(volumeLabel);
    panel.add(volumeSlider);
    panel.add(cancelButton);
    panel.add(saveButton);
    add(panel);
}

24. NurseRosteringPanel#createHeaderPanel()

Project: optaplanner
File: NurseRosteringPanel.java
private JPanel createHeaderPanel() {
    JPanel headerPanel = new JPanel(new BorderLayout(20, 0));
    JPanel planningWindowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    planningWindowPanel.add(new JLabel("Planning window start:"));
    planningWindowStartField = new JTextField(10);
    planningWindowStartField.setEditable(false);
    planningWindowPanel.add(planningWindowStartField);
    advancePlanningWindowStartAction = new AbstractAction("Advance 1 day into the future") {

        @Override
        public void actionPerformed(ActionEvent e) {
            advancePlanningWindowStart();
        }
    };
    advancePlanningWindowStartAction.setEnabled(false);
    planningWindowPanel.add(new JButton(advancePlanningWindowStartAction));
    headerPanel.add(planningWindowPanel, BorderLayout.WEST);
    JLabel shiftTypeExplanation = new JLabel("E = Early shift, L = Late shift, ...");
    headerPanel.add(shiftTypeExplanation, BorderLayout.CENTER);
    return headerPanel;
}

25. OptaPlannerExamplesApp#createDifficultExamplesPanel()

Project: optaplanner
File: OptaPlannerExamplesApp.java
private JPanel createDifficultExamplesPanel() {
    JPanel panel = new JPanel(new GridLayout(0, 1, 5, 5));
    TitledBorder titledBorder = BorderFactory.createTitledBorder("Difficult examples");
    titledBorder.setTitleColor(TangoColorFactory.SCARLET_3);
    panel.setBorder(BorderFactory.createCompoundBorder(titledBorder, BorderFactory.createEmptyBorder(5, 5, 5, 5)));
    panel.add(createExampleButton(new ExaminationApp()));
    panel.add(createExampleButton(new NurseRosteringApp()));
    panel.add(createExampleButton(new TravelingTournamentApp()));
    panel.add(createExampleButton(new CheapTimeApp()));
    panel.add(createExampleButton(new InvestmentApp()));
    return panel;
}

26. BenchmarkAggregatorFrame#createTopButtonPanel()

Project: optaplanner
File: BenchmarkAggregatorFrame.java
private JComponent createTopButtonPanel() {
    JPanel buttonPanel = new JPanel(new GridLayout(1, 6));
    buttonPanel.add(new JButton(new ExpandNodesAction()));
    buttonPanel.add(new JButton(new CollapseNodesAction()));
    buttonPanel.add(new JButton(new MoveNodeAction(true)));
    buttonPanel.add(new JButton(new MoveNodeAction(false)));
    renameNodeButton = new JButton(new RenameNodeAction());
    renameNodeButton.setEnabled(false);
    buttonPanel.add(renameNodeButton);
    buttonPanel.add(new JButton(new SwitchLevelsAction(false)));
    return buttonPanel;
}

27. CursorOverlappedPanelsTest#createPanel()

Project: openjdk
File: CursorOverlappedPanelsTest.java
// start()
//The rest of this class is the actions which perform the test...
//Use Sysout.println to communicate with the user NOT System.out!!
//Sysout.println ("Something Happened!");
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}

28. MyExperimentConfigurationPanel#initialiseUI()

Project: incubator-taverna-workbench
File: MyExperimentConfigurationPanel.java
private void initialiseUI() {
    // this constraints instance will be shared among all components in the window
    GridBagConstraints c = new GridBagConstraints();
    // create the myExperiment API address box
    JPanel jpApiLocation = new JPanel();
    jpApiLocation.setLayout(new GridBagLayout());
    Insets insLabel = new Insets(0, 0, 0, 10);
    Insets insParam = new Insets(0, 3, 5, 3);
    // Title describing what kind of settings we are configuring here
    JTextArea descriptionText = new JTextArea("Configure the myExperiment integration functionality");
    descriptionText.setLineWrap(true);
    descriptionText.setWrapStyleWord(true);
    descriptionText.setEditable(false);
    descriptionText.setFocusable(false);
    descriptionText.setBorder(new EmptyBorder(10, 10, 10, 10));
    c.anchor = GridBagConstraints.WEST;
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 1.0;
    c.weighty = 0.0;
    c.fill = GridBagConstraints.HORIZONTAL;
    jpApiLocation.add(descriptionText, c);
    c.gridx = 0;
    c.gridy = 1;
    c.weightx = 1.0;
    //c.insets = insLabel;
    c.anchor = GridBagConstraints.WEST;
    c.insets = new Insets(10, 0, 0, 10);
    jpApiLocation.add(new JLabel("Base URL of myExperiment instance to connect to"), c);
    c.gridy = 2;
    //c.insets = insParam;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(0, 0, 0, 0);
    this.tfMyExperimentURL = new JTextField();
    this.tfMyExperimentURL.setToolTipText("<html>Here you can specify the base URL of the myExperiment " + "instance that you wish to connect to.<br>This allows the plugin to connect not only to the " + "<b>main myExperiment website</b> (default value:<br><b>http://www.myexperiment.org</b>) but " + "also to any other myExperiment instance that might<br>exist elsewhere.<br><br>It is recommended " + "that you only change this setting if you are certain in your actions.</html>");
    jpApiLocation.add(this.tfMyExperimentURL, c);
    // create startup tab choice box
    JPanel jpStartupTabChoice = new JPanel();
    jpStartupTabChoice.setLayout(new GridBagLayout());
    c.gridy = 0;
    c.insets = insLabel;
    jpStartupTabChoice.add(new JLabel("Default startup tab for anonymous user"), c);
    c.gridx = 1;
    c.insets = insParam;
    this.cbDefaultNotLoggedInTab = new JComboBox(this.alPluginTabComponentNames.toArray());
    this.cbDefaultNotLoggedInTab.setToolTipText("<html>This tab will be automatically opened at plugin start up time if you are <b>not</b> logged id to myExperiment.</html>");
    jpStartupTabChoice.add(this.cbDefaultNotLoggedInTab, c);
    c.gridy = 1;
    c.gridx = 0;
    c.insets = insLabel;
    jpStartupTabChoice.add(new JLabel("Default startup tab after successful auto-login"), c);
    c.gridx = 1;
    c.insets = insParam;
    this.cbDefaultLoggedInTab = new JComboBox(this.alPluginTabComponentNames.toArray());
    this.cbDefaultLoggedInTab.setToolTipText("<html>This tab will be automatically opened at plugin start up time if you have chosen to use <b>auto logging in</b> to myExperiment.</html>");
    jpStartupTabChoice.add(this.cbDefaultLoggedInTab, c);
    // create 'my stuff' tab preference box
    JPanel jpMyStuffPrefs = new JPanel();
    jpMyStuffPrefs.setLayout(new GridBagLayout());
    c.gridx = 0;
    c.gridy = 0;
    c.insets = insLabel;
    jpMyStuffPrefs.add(new JLabel("Sections to show in this tab:"), c);
    c.gridx = 1;
    c.gridy = 0;
    c.weightx = 1.0;
    c.insets = new Insets(insParam.top, 100, insParam.bottom / 3, insParam.right);
    this.cbMyStuffWorkflows = new JCheckBox("My Workflows");
    jpMyStuffPrefs.add(this.cbMyStuffWorkflows, c);
    c.gridy = 1;
    this.cbMyStuffFiles = new JCheckBox("My Files");
    jpMyStuffPrefs.add(this.cbMyStuffFiles, c);
    c.gridy = 2;
    this.cbMyStuffPacks = new JCheckBox("My Packs");
    jpMyStuffPrefs.add(this.cbMyStuffPacks, c);
    // create button panel
    this.bApply = new JButton("Apply");
    this.bApply.addActionListener(this);
    this.bReset = new JButton("Reset");
    this.bReset.addActionListener(this);
    this.bHelp = new JButton("Help");
    this.bHelp.addActionListener(this);
    JPanel jpButtons = new JPanel();
    jpButtons.add(bHelp, c);
    jpButtons.add(bReset, c);
    jpButtons.add(bApply, c);
    // PUT EVERYTHING TOGETHER
    JPanel jpEverything = new JPanel();
    GridBagLayout jpEverythingLayout = new GridBagLayout();
    jpEverything.setLayout(jpEverythingLayout);
    GridBagConstraints gbConstraints = new GridBagConstraints();
    gbConstraints.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.NORTHWEST;
    gbConstraints.weightx = 1;
    gbConstraints.gridx = 0;
    gbConstraints.gridy = 0;
    jpEverything.add(jpApiLocation, gbConstraints);
    gbConstraints.gridy++;
    jpEverything.add(jpStartupTabChoice, gbConstraints);
    gbConstraints.gridy++;
    jpEverything.add(jpMyStuffPrefs, gbConstraints);
    gbConstraints.gridy++;
    c.insets = new Insets(10, 0, 0, 0);
    jpEverything.add(jpButtons, gbConstraints);
    BorderLayout layout = new BorderLayout();
    this.setLayout(layout);
    this.add(jpEverything, BorderLayout.NORTH);
    if (MyExperimentClient.baseChangedSinceLastStart) {
        JPanel jpInfo = new JPanel();
        jpInfo.setLayout(new BoxLayout(jpInfo, BoxLayout.Y_AXIS));
        String info = "<html>Your myExperiment base url has been modified since Taverna was started;<br>" + "this change will not take effect until you restart Taverna.</html>";
        jpInfo.add(new JLabel(info, WorkbenchIcons.leafIcon, SwingConstants.LEFT));
        this.add(jpInfo, BorderLayout.SOUTH);
    }
}

29. ReplaceByComponentAction#actionPerformed()

Project: incubator-taverna-plugin-component
File: ReplaceByComponentAction.java
@Override
public void actionPerformed(ActionEvent e) {
    JPanel overallPanel = new JPanel(new BorderLayout());
    ComponentChooserPanel panel = new ComponentChooserPanel(prefs);
    overallPanel.add(panel, CENTER);
    JPanel checkBoxPanel = new JPanel(new FlowLayout());
    JCheckBox replaceAllCheckBox = new JCheckBox("Replace all matching services");
    checkBoxPanel.add(replaceAllCheckBox);
    checkBoxPanel.add(new JSeparator());
    JCheckBox renameServicesCheckBox = new JCheckBox("Rename service(s)");
    checkBoxPanel.add(renameServicesCheckBox);
    renameServicesCheckBox.setSelected(true);
    overallPanel.add(checkBoxPanel, SOUTH);
    int answer = showConfirmDialog(null, overallPanel, "Component choice", OK_CANCEL_OPTION);
    if (answer == OK_OPTION)
        doReplace(panel.getChosenRegistry(), panel.getChosenFamily(), replaceAllCheckBox.isSelected(), renameServicesCheckBox.isSelected(), panel.getChosenComponent());
}

30. FrameMain#createGUI()

Project: Gaea
File: FrameMain.java
public void createGUI() {
    /**tree button*/
    JPanel topPanel = new JPanel(new BorderLayout());
    JTextArea keyjta = new JTextArea(10, 10);
    topPanel.add(new JScrollPane(TreeFrame.create().buildTree()), BorderLayout.CENTER);
    topPanel.add(new ButtonFrame(keyjta), BorderLayout.SOUTH);
    topPanel.setName("top");
    /**key???*/
    JPanel downPanel = new JPanel(new BorderLayout());
    downPanel.add(new JScrollPane(keyjta), BorderLayout.CENTER);
    downPanel.setName("down");
    this.getContentPane().add(topPanel, BorderLayout.CENTER);
    this.getContentPane().add(downPanel, BorderLayout.SOUTH);
    this.getContentPane().validate();
}

31. StandaloneGUIBuilder#createSearchPanel()

Project: umlet
File: StandaloneGUIBuilder.java
public JPanel createSearchPanel() {
    createSearchField();
    JPanel searchPanel = new JPanel();
    searchPanel.setOpaque(false);
    searchPanel.setLayout(new BoxLayout(searchPanel, BoxLayout.X_AXIS));
    searchPanel.add(Box.createRigidArea(new Dimension(50, 0)));
    searchPanel.add(new JLabel("Search:   "));
    searchPanel.add(searchField);
    searchPanel.add(Box.createRigidArea(new Dimension(20, 0)));
    return searchPanel;
}

32. CSettingsPanelBuilder#addComponent()

Project: binnavi
File: CSettingsPanelBuilder.java
/**
   * Adds a component that is used to configure a setting.
   *
   * @param panel The panel the component is added to.
   * @param component The component to add to the panel.
   * @param description The text of the label to be put next to the combobox.
   * @param hint Tooltip shown when the user mouse-overs the created hint icon.
   */
private static void addComponent(final JPanel panel, final Component component, final String description, final String hint) {
    final JPanel settingPanel = new JPanel(new BorderLayout());
    settingPanel.setBorder(STANDARD_EMPTY_BORDER);
    settingPanel.add(new JLabel(description), BorderLayout.CENTER);
    final JPanel innerPanel = new JPanel(new BorderLayout());
    innerPanel.add(component, BorderLayout.CENTER);
    final JHintIcon hintPopup = new JHintIcon(hint);
    hintPopup.setBorder(new EmptyBorder(0, 3, 0, 0));
    innerPanel.add(hintPopup, BorderLayout.EAST);
    settingPanel.add(innerPanel, BorderLayout.EAST);
    panel.add(settingPanel);
}

33. ButtonDemo#createControls()

Project: beautyeye
File: ButtonDemo.java
/**
     * Creates the controls.
     *
     * @return the j panel
     */
public JPanel createControls() {
    JPanel controls = new JPanel() {

        public Dimension getMaximumSize() {
            return new Dimension(300, super.getMaximumSize().height);
        }
    };
    controls.setLayout(new BoxLayout(controls, BoxLayout.Y_AXIS));
    controls.setAlignmentY(TOP_ALIGNMENT);
    controls.setAlignmentX(LEFT_ALIGNMENT);
    JPanel buttonControls = createHorizontalPanel(true);
    buttonControls.setAlignmentY(TOP_ALIGNMENT);
    buttonControls.setAlignmentX(LEFT_ALIGNMENT);
    JPanel leftColumn = createVerticalPanel(false);
    leftColumn.setAlignmentX(LEFT_ALIGNMENT);
    leftColumn.setAlignmentY(TOP_ALIGNMENT);
    JPanel rightColumn = new LayoutControlPanel(this);
    buttonControls.add(leftColumn);
    buttonControls.add(Box.createRigidArea(HGAP20));
    buttonControls.add(rightColumn);
    buttonControls.add(Box.createRigidArea(HGAP20));
    controls.add(buttonControls);
    createListeners();
    // Display Options
    //* modified by jb2011????????????label
    //JLabel l = new JLabel(getString("ButtonDemo.controlpanel_label"));
    JLabel l = N9ComponentFactory.createLabel_style4(getString("ButtonDemo.controlpanel_label"));
    leftColumn.add(l);
    JCheckBox bordered = new JCheckBox(getString("ButtonDemo.paintborder"));
    bordered.setActionCommand("PaintBorder");
    bordered.setToolTipText(getString("ButtonDemo.paintborder_tooltip"));
    bordered.setMnemonic(getMnemonic("ButtonDemo.paintborder_mnemonic"));
    if (currentControls == buttons) {
        bordered.setSelected(true);
    }
    bordered.addItemListener(buttonDisplayListener);
    leftColumn.add(bordered);
    JCheckBox focused = new JCheckBox(getString("ButtonDemo.paintfocus"));
    focused.setActionCommand("PaintFocus");
    focused.setToolTipText(getString("ButtonDemo.paintfocus_tooltip"));
    focused.setMnemonic(getMnemonic("ButtonDemo.paintfocus_mnemonic"));
    focused.setSelected(true);
    focused.addItemListener(buttonDisplayListener);
    leftColumn.add(focused);
    JCheckBox enabled = new JCheckBox(getString("ButtonDemo.enabled"));
    enabled.setActionCommand("Enabled");
    enabled.setToolTipText(getString("ButtonDemo.enabled_tooltip"));
    enabled.setSelected(true);
    enabled.addItemListener(buttonDisplayListener);
    enabled.setMnemonic(getMnemonic("ButtonDemo.enabled_mnemonic"));
    leftColumn.add(enabled);
    JCheckBox filled = new JCheckBox(getString("ButtonDemo.contentfilled"));
    filled.setActionCommand("ContentFilled");
    filled.setToolTipText(getString("ButtonDemo.contentfilled_tooltip"));
    filled.setSelected(true);
    filled.addItemListener(buttonDisplayListener);
    filled.setMnemonic(getMnemonic("ButtonDemo.contentfilled_mnemonic"));
    leftColumn.add(filled);
    leftColumn.add(Box.createRigidArea(VGAP20));
    //* modified by jb2011????????????label
    // l = new JLabel(getString("ButtonDemo.padamount_label"));
    l = N9ComponentFactory.createLabel_style4(getString("ButtonDemo.padamount_label"));
    leftColumn.add(l);
    ButtonGroup group = new ButtonGroup();
    JRadioButton defaultPad = new JRadioButton(getString("ButtonDemo.default"));
    defaultPad.setToolTipText(getString("ButtonDemo.default_tooltip"));
    defaultPad.setMnemonic(getMnemonic("ButtonDemo.default_mnemonic"));
    defaultPad.addItemListener(buttonPadListener);
    group.add(defaultPad);
    defaultPad.setSelected(true);
    leftColumn.add(defaultPad);
    JRadioButton zeroPad = new JRadioButton(getString("ButtonDemo.zero"));
    zeroPad.setActionCommand("ZeroPad");
    zeroPad.setToolTipText(getString("ButtonDemo.zero_tooltip"));
    zeroPad.addItemListener(buttonPadListener);
    zeroPad.setMnemonic(getMnemonic("ButtonDemo.zero_mnemonic"));
    group.add(zeroPad);
    leftColumn.add(zeroPad);
    JRadioButton tenPad = new JRadioButton(getString("ButtonDemo.ten"));
    tenPad.setActionCommand("TenPad");
    tenPad.setMnemonic(getMnemonic("ButtonDemo.ten_mnemonic"));
    tenPad.setToolTipText(getString("ButtonDemo.ten_tooltip"));
    tenPad.addItemListener(buttonPadListener);
    group.add(tenPad);
    leftColumn.add(tenPad);
    leftColumn.add(Box.createRigidArea(VGAP20));
    return controls;
}

34. TableGui#createTableCardinalityArea()

Project: h-store
File: TableGui.java
private JPanel createTableCardinalityArea() {
    JPanel paneTblCardinality = new JPanel();
    paneTblCardinality.setLayout(new BoxLayout(paneTblCardinality, BoxLayout.LINE_AXIS));
    paneTblCardinality.setBorder(BorderFactory.createLineBorder(Color.GRAY));
    JLabel lblCard = new JLabel("Table Cardinality (press \"Enter\" to confirm): ");
    paneTblCardinality.add(lblCard);
    m_txtCardinality.setColumns(5);
    paneTblCardinality.add(m_txtCardinality);
    paneTblCardinality.setBounds(m_scrollTblName.getWidth() + GuiConstants.GAP_COMPONENT, m_nYOffsetInRightPane, s_nRightPaneWidth, s_nOneRowPaneHeight);
    m_nYOffsetInRightPane += (s_nOneRowPaneHeight + GuiConstants.GAP_COMPONENT);
    return paneTblCardinality;
}

35. TableGui#createTableCSVArea()

Project: h-store
File: TableGui.java
private JPanel createTableCSVArea() {
    JPanel paneCSV = new JPanel();
    paneCSV.setLayout(new BoxLayout(paneCSV, BoxLayout.X_AXIS));
    paneCSV.setBorder(BorderFactory.createLineBorder(Color.GRAY));
    paneCSV.add(m_checkLinkCsv);
    paneCSV.add(m_txtLinkCsvPath);
    m_txtLinkCsvPath.setEditable(false);
    paneCSV.setBounds(m_scrollTblName.getWidth() + GuiConstants.GAP_COMPONENT, m_nYOffsetInRightPane, s_nRightPaneWidth, s_nOneRowPaneHeight);
    m_nYOffsetInRightPane += (s_nOneRowPaneHeight + GuiConstants.GAP_COMPONENT);
    return paneCSV;
}

36. ProcGui#createProcParasPane()

Project: h-store
File: ProcGui.java
private JPanel createProcParasPane(JPanel parent) {
    JPanel paneProcParas = new JPanel();
    paneProcParas.setLayout(null);
    paneProcParas.setBorder(BorderFactory.createEtchedBorder());
    int nYStartPaneProcParas = m_paneProbability.getHeight() + GuiConstants.GAP_COMPONENT;
    paneProcParas.setBounds(0, nYStartPaneProcParas, parent.getWidth(), parent.getHeight() - nYStartPaneProcParas);
    LHSListPane scrollParaNames = new LHSListPane(paneProcParas, m_lstProcParaNames);
    paneProcParas.add(scrollParaNames);
    paneProcParas.add(m_paneParaDistribution);
    int nXStartParaDistribution = scrollParaNames.getWidth() + GuiConstants.GAP_COMPONENT;
    int nWidthParaDistribution = paneProcParas.getWidth() - nXStartParaDistribution - GuiConstants.GAP_COMPONENT;
    int nHeightParaDistribution = scrollParaNames.getHeight() - 2 * GuiConstants.GAP_COMPONENT;
    m_paneParaDistribution.setBounds(nXStartParaDistribution, GuiConstants.GAP_COMPONENT, nWidthParaDistribution, nHeightParaDistribution);
    m_paneParaDistribution.add(s_paneDummy);
    return paneProcParas;
}

37. ExportAsPngDialog#getImageSizePanel()

Project: la-images
File: ExportAsPngDialog.java
private JPanel getImageSizePanel() {
    JPanel imageSizePanel = new JPanel();
    imageSizePanel.setLayout(new GridLayout(1, 4));
    NumberFormat format = NumberFormat.getInstance();
    format.setGroupingUsed(false);
    NumberFormatter formatter = new NumberFormatter(format);
    formatter.setValueClass(Integer.class);
    formatter.setMinimum(0);
    formatter.setMaximum(Integer.MAX_VALUE);
    formatter.setCommitsOnValidEdit(true);
    widthTF = new JFormattedTextField(formatter);
    widthTF.setValue(1200);
    widthTF.addFocusListener(FOCUS_LISTENER);
    heightTF = new JFormattedTextField(formatter);
    heightTF.setValue(1000);
    heightTF.addFocusListener(FOCUS_LISTENER);
    imageSizePanel.add(new JLabel(" Width:"));
    imageSizePanel.add(widthTF);
    imageSizePanel.add(new JLabel(" Height:"));
    imageSizePanel.add(heightTF);
    return imageSizePanel;
}

38. ExportAllAsPngDialog#getRangePanel()

Project: la-images
File: ExportAllAsPngDialog.java
private JPanel getRangePanel() {
    JPanel rangePanel = new JPanel();
    rangePanel.setLayout(new GridLayout(1, 4));
    minRangeValue = new FloatTextField(0);
    maxRangeValue = new FloatTextField(1);
    addFocusListener(minRangeValue);
    addFocusListener(maxRangeValue);
    setColorMapRangeControlsEnabled(false);
    PropertyChangeListener listener =  e -> checkRangeValues();
    minRangeValue.addPropertyChangeListener("value", listener);
    maxRangeValue.addPropertyChangeListener("value", listener);
    rangePanel.add(new JLabel(" Min.:"));
    rangePanel.add(minRangeValue);
    rangePanel.add(new JLabel(" Max.:"));
    rangePanel.add(maxRangeValue);
    return rangePanel;
}

39. ExportAllAsPngDialog#getImageSizePanel()

Project: la-images
File: ExportAllAsPngDialog.java
private JPanel getImageSizePanel() {
    JPanel imageSizePanel = new JPanel();
    imageSizePanel.setLayout(new GridLayout(1, 4));
    NumberFormat format = NumberFormat.getInstance();
    format.setGroupingUsed(false);
    NumberFormatter formatter = new NumberFormatter(format);
    formatter.setValueClass(Integer.class);
    formatter.setMinimum(0);
    formatter.setMaximum(Integer.MAX_VALUE);
    formatter.setCommitsOnValidEdit(true);
    widthTF = new JFormattedTextField(formatter);
    widthTF.setValue(1200);
    addFocusListener(widthTF);
    heightTF = new JFormattedTextField(formatter);
    heightTF.setValue(1000);
    addFocusListener(heightTF);
    imageSizePanel.add(new JLabel(" Width:"));
    imageSizePanel.add(widthTF);
    imageSizePanel.add(new JLabel(" Height:"));
    imageSizePanel.add(heightTF);
    return imageSizePanel;
}

40. ReportViewComponent#wrapComponent()

Project: incubator-taverna-workbench
File: ReportViewComponent.java
private JPanel wrapComponent(JComponent c) {
    JPanel result = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridwidth = 2;
    gbc.weightx = 0.9;
    gbc.insets = rightGap;
    result.add(c, gbc);
    c.setBackground(SystemColor.text);
    gbc.weightx = 0.9;
    gbc.weighty = 0.9;
    gbc.gridx = 0;
    gbc.gridy++;
    gbc.gridwidth = 2;
    gbc.fill = GridBagConstraints.BOTH;
    JPanel filler = new JPanel();
    filler.setBackground(SystemColor.text);
    result.setBackground(SystemColor.text);
    result.add(filler, gbc);
    return result;
}

41. DesignPerspectiveComponent#createRightComponent()

Project: incubator-taverna-workbench
File: DesignPerspectiveComponent.java
private Component createRightComponent() {
    JPanel diagramComponent = new JPanel(new BorderLayout());
    diagramComponent.add(new WorkflowSelectorComponent(selectionManager), NORTH);
    diagramComponent.add((Component) graphViewComponentFactory.getComponent(), CENTER);
    JPanel rightComonent = new JPanel(new BorderLayout());
    rightComonent.add(new WorkflowBundleSelectorComponent(selectionManager, fileManager, menuManager, editManager), NORTH);
    rightComonent.add(diagramComponent, CENTER);
    return rightComonent;
}

42. MergeContextualView#panelForHtml()

Project: incubator-taverna-workbench
File: MergeContextualView.java
protected JPanel panelForHtml(JEditorPane editorPane) {
    final JPanel panel = new JPanel();
    JPanel buttonPanel = new JPanel(new FlowLayout(LEFT));
    JButton configureButton = new JButton(new AbstractAction() {

        @Override
        public void actionPerformed(ActionEvent e) {
            MergeConfigurationView mergeConfigurationView = new MergeConfigurationView(datalinks, editManager, selectionManager);
            mergeConfigurationView.setLocationRelativeTo(panel);
            mergeConfigurationView.setVisible(true);
        }
    });
    configureButton.setText("Configure");
    buttonPanel.add(configureButton);
    panel.setLayout(new BorderLayout());
    panel.add(editorPane, CENTER);
    panel.add(buttonPanel, SOUTH);
    return panel;
}

43. COptionsPanel#buildRow()

Project: binnavi
File: COptionsPanel.java
/**
   * Builds a single row of components in the panel.
   * 
   * @param <T> Type of the editing component.
   * 
   * @param panel Panel the editing component is added to.
   * @param description Type description to be configured in that row.
   * @param hint Hint shown as a tooltip.
   * @param component The component to add to the panel.
   * @param isLast True, if the component is the last component to be added to the panel.
   * 
   * @return The panel passed to the function.
   */
private <T extends Component> T buildRow(final JPanel panel, final ITypeDescription description, final String hint, final T component, final boolean isLast) {
    component.setPreferredSize(new Dimension(COLORPANEL_WIDTH, COLORPANEL_HEIGHT));
    final JPanel rowPanel = new JPanel(new BorderLayout());
    rowPanel.setBorder(new EmptyBorder(0, 2, isLast ? 2 : 0, 2));
    final JPanel innerPanel = new JPanel(new GridLayout(1, 2));
    innerPanel.add(new JCheckBox(new CheckboxAction(description, description.getDescription() + ":")), BorderLayout.CENTER);
    innerPanel.add(CHintCreator.createHintPanel(component, hint), BorderLayout.EAST);
    rowPanel.add(innerPanel, BorderLayout.WEST);
    panel.add(rowPanel);
    return component;
}

44. CVisibilityCriteriumPanel#initPanel()

Project: binnavi
File: CVisibilityCriteriumPanel.java
/**
   * Creates the GUI of the panel.
   */
private void initPanel() {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(new TitledBorder("Edit Visibility Condition"));
    final JPanel comboPanel = new JPanel(new BorderLayout());
    comboPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    visibilityStateBox.addItem(VisibilityState.VISIBLE);
    visibilityStateBox.addItem(VisibilityState.UNVISIBLE);
    comboPanel.add(visibilityStateBox, BorderLayout.CENTER);
    mainPanel.add(comboPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}

45. CTagCriteriumPanel#initPanel()

Project: binnavi
File: CTagCriteriumPanel.java
/**
   * Initializes the GUI of the tag.
   *
   * @param rootTag Root node of the tag tree to show.
   */
private void initPanel(final ITreeNode<CTag> rootTag) {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(new TitledBorder("Edit Tag Condition"));
    createTree(rootTag);
    final JScrollPane pane = new JScrollPane(m_tagTree);
    pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    final JPanel anyTagPanel = new JPanel();
    anyTagPanel.add(m_anyTagBox);
    mainPanel.add(pane, BorderLayout.CENTER);
    mainPanel.add(m_anyTagBox, BorderLayout.SOUTH);
    add(mainPanel, BorderLayout.CENTER);
}

46. CSelectionCriteriumPanel#initPanel()

Project: binnavi
File: CSelectionCriteriumPanel.java
/**
   * Creates the GUI of the panel.
   */
private void initPanel() {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(new TitledBorder("Edit Selection Condition"));
    final JPanel comboPanel = new JPanel(new BorderLayout());
    comboPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    selectionStateBox.addItem(SelectionState.SELECTED);
    selectionStateBox.addItem(SelectionState.UNSELECTED);
    comboPanel.add(selectionStateBox, BorderLayout.CENTER);
    mainPanel.add(comboPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}

47. ArrowIcon#main()

Project: beautyeye
File: ArrowIcon.java
public static void main(String args[]) {
    JFrame frame = new JFrame();
    JPanel panel = new JPanel();
    frame.add(panel);
    panel.add(new JLabel("north", new ArrowIcon(ArrowIcon.NORTH), JLabel.CENTER));
    panel.add(new JLabel("west", new ArrowIcon(ArrowIcon.WEST), JLabel.CENTER));
    panel.add(new JLabel("south", new ArrowIcon(ArrowIcon.SOUTH), JLabel.CENTER));
    panel.add(new JLabel("east", new ArrowIcon(ArrowIcon.EAST), JLabel.CENTER));
    panel.add(new JLabel("east-20", new ArrowIcon(ArrowIcon.EAST, 20, Color.blue), JLabel.CENTER));
    frame.pack();
    frame.setVisible(true);
}

48. SliderDemo#createVerticalHintBox()

Project: beautyeye
File: SliderDemo.java
/**
     * Creates the vertical hint box.
     *
     * @param c the c
     * @param txt the txt
     * @return the j panel
     */
public static JPanel createVerticalHintBox(JComponent c, String txt) {
    JPanel p = new JPanel();
    p.setOpaque(false);
    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
    JLabel l1 = N9ComponentFactory.createLabel_style3(txt);
    l1.setAlignmentX(Component.CENTER_ALIGNMENT);
    p.add(l1);
    c.setAlignmentX(Component.CENTER_ALIGNMENT);
    p.add(c);
    p.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0));
    return p;
}

49. OptaPlannerExamplesApp#createExamplesPanel()

Project: optaplanner
File: OptaPlannerExamplesApp.java
private JPanel createExamplesPanel() {
    JPanel examplesPanel = new JPanel();
    examplesPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    GroupLayout layout = new GroupLayout(examplesPanel);
    examplesPanel.setLayout(layout);
    JPanel basicExamplesPanel = createBasicExamplesPanel();
    JPanel realExamplesPanel = createRealExamplesPanel();
    JPanel difficultExamplesPanel = createDifficultExamplesPanel();
    layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(basicExamplesPanel).addGap(10).addComponent(realExamplesPanel).addGap(10).addComponent(difficultExamplesPanel));
    layout.setVerticalGroup(layout.createParallelGroup().addComponent(basicExamplesPanel).addComponent(realExamplesPanel).addComponent(difficultExamplesPanel));
    return examplesPanel;
}

50. MachineControlsPanel#createUi()

Project: openpnp
File: MachineControlsPanel.java
private void createUi() {
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    ButtonGroup buttonGroup = new ButtonGroup();
    JPanel panel = new JPanel();
    add(panel);
    panel.setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow") }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }));
    comboBoxNozzles = new JComboBox();
    comboBoxNozzles.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            setSelectedNozzle(((NozzleItem) comboBoxNozzles.getSelectedItem()).getNozzle());
        }
    });
    panel.add(comboBoxNozzles, "2, 2, fill, default");
    JPanel panelDrosParent = new JPanel();
    add(panelDrosParent);
    panelDrosParent.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
    JPanel panelDros = new JPanel();
    panelDrosParent.add(panelDros);
    panelDros.setLayout(new BoxLayout(panelDros, BoxLayout.Y_AXIS));
    JPanel panelDrosFirstLine = new JPanel();
    panelDros.add(panelDrosFirstLine);
    panelDrosFirstLine.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
    JLabel lblX = new JLabel("X");
    lblX.setFont(new Font("Lucida Grande", Font.BOLD, 24));
    panelDrosFirstLine.add(lblX);
    textFieldX = new JTextField();
    textFieldX.setEditable(false);
    textFieldX.setFocusTraversalKeysEnabled(false);
    textFieldX.setSelectionColor(droEditingColor);
    textFieldX.setDisabledTextColor(Color.BLACK);
    textFieldX.setBackground(droNormalColor);
    textFieldX.setFont(new Font("Lucida Grande", Font.BOLD, 24));
    textFieldX.setText("0000.0000");
    textFieldX.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (SwingUtilities.isRightMouseButton(e)) {
                savedX = Double.NaN;
            }
            saveXAction.actionPerformed(null);
        }
    });
    panelDrosFirstLine.add(textFieldX);
    textFieldX.setColumns(6);
    Component horizontalStrut = Box.createHorizontalStrut(15);
    panelDrosFirstLine.add(horizontalStrut);
    JLabel lblY = new JLabel("Y");
    lblY.setFont(new Font("Lucida Grande", Font.BOLD, 24));
    panelDrosFirstLine.add(lblY);
    textFieldY = new JTextField();
    textFieldY.setEditable(false);
    textFieldY.setFocusTraversalKeysEnabled(false);
    textFieldY.setSelectionColor(droEditingColor);
    textFieldY.setDisabledTextColor(Color.BLACK);
    textFieldY.setBackground(droNormalColor);
    textFieldY.setFont(new Font("Lucida Grande", Font.BOLD, 24));
    textFieldY.setText("0000.0000");
    textFieldY.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (SwingUtilities.isRightMouseButton(e)) {
                savedY = Double.NaN;
            }
            saveYAction.actionPerformed(null);
        }
    });
    panelDrosFirstLine.add(textFieldY);
    textFieldY.setColumns(6);
    JButton btnTargetTool = new JButton(targetToolAction);
    panelDrosFirstLine.add(btnTargetTool);
    btnTargetTool.setToolTipText("Position the tool at the camera's current location.");
    JPanel panelDrosSecondLine = new JPanel();
    panelDros.add(panelDrosSecondLine);
    panelDrosSecondLine.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
    JLabel lblC = new JLabel("C");
    lblC.setFont(new Font("Lucida Grande", Font.BOLD, 24));
    panelDrosSecondLine.add(lblC);
    textFieldC = new JTextField();
    textFieldC.setEditable(false);
    textFieldC.setFocusTraversalKeysEnabled(false);
    textFieldC.setSelectionColor(droEditingColor);
    textFieldC.setDisabledTextColor(Color.BLACK);
    textFieldC.setBackground(droNormalColor);
    textFieldC.setText("0000.0000");
    textFieldC.setFont(new Font("Lucida Grande", Font.BOLD, 24));
    textFieldC.setColumns(6);
    textFieldC.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (SwingUtilities.isRightMouseButton(e)) {
                savedC = Double.NaN;
            }
            saveCAction.actionPerformed(null);
        }
    });
    panelDrosSecondLine.add(textFieldC);
    Component horizontalStrut_1 = Box.createHorizontalStrut(15);
    panelDrosSecondLine.add(horizontalStrut_1);
    JLabel lblZ = new JLabel("Z");
    lblZ.setFont(new Font("Lucida Grande", Font.BOLD, 24));
    panelDrosSecondLine.add(lblZ);
    textFieldZ = new JTextField();
    textFieldZ.setEditable(false);
    textFieldZ.setFocusTraversalKeysEnabled(false);
    textFieldZ.setSelectionColor(droEditingColor);
    textFieldZ.setDisabledTextColor(Color.BLACK);
    textFieldZ.setBackground(droNormalColor);
    textFieldZ.setText("0000.0000");
    textFieldZ.setFont(new Font("Lucida Grande", Font.BOLD, 24));
    textFieldZ.setColumns(6);
    textFieldZ.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            if (SwingUtilities.isRightMouseButton(e)) {
                savedZ = Double.NaN;
            }
            saveZAction.actionPerformed(null);
        }
    });
    panelDrosSecondLine.add(textFieldZ);
    JButton btnTargetCamera = new JButton(targetCameraAction);
    panelDrosSecondLine.add(btnTargetCamera);
    btnTargetCamera.setToolTipText("Position the camera at the tool's current location.");
    add(jogControlsPanel);
}

51. MakelangeloRobotPanel#createAnimationPanel()

Project: Makelangelo
File: MakelangeloRobotPanel.java
private JPanel createAnimationPanel() {
    CollapsiblePanel animationPanel = new CollapsiblePanel(Translator.get("MenuAnimate"));
    JPanel drivePanel = animationPanel.getContentPane();
    drivePanel.setLayout(new GridLayout(4, 1));
    buttonStart = new JButton(Translator.get("Start"));
    buttonStartAt = new JButton(Translator.get("StartAtLine"));
    buttonPause = new JButton(Translator.get("Pause"));
    buttonHalt = new JButton(Translator.get("Halt"));
    buttonStart.addActionListener(this);
    buttonStartAt.addActionListener(this);
    buttonPause.addActionListener(this);
    buttonHalt.addActionListener(this);
    drivePanel.add(buttonStart);
    drivePanel.add(buttonStartAt);
    drivePanel.add(buttonPause);
    drivePanel.add(buttonHalt);
    return animationPanel;
}

52. ResourcePreviewFactory#wrapTextPaneAndTabbedViewIntoFullPreview()

Project: incubator-taverna-workbench
File: ResourcePreviewFactory.java
private JPanel wrapTextPaneAndTabbedViewIntoFullPreview(JTextPane tpHTMLPreview, JTabbedPane tpTabbedView) {
    // WRAPS HTML JTextPane PREVIEW AND A JTabbedPane WITH DETAILS INTO A SINGLE
    // PREVIEW PANEL
    JPanel jpFullPreview = new JPanel();
    // white background for the whole
    jpFullPreview.setBackground(Color.WHITE);
    // preview panel
    jpFullPreview.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = GridBagConstraints.REMAINDER;
    c.gridy = 0;
    // will not change size when the window is resized
    c.weighty = 0;
    jpFullPreview.add(tpHTMLPreview, c);
    c.gridx = GridBagConstraints.REMAINDER;
    c.gridy = 1;
    // will grow in size when the window is resized..
    c.weighty = 1;
    // ..and fill all available space
    c.fill = GridBagConstraints.VERTICAL;
    // vertically
    // a bit of margin at the top & bottom
    c.insets = new Insets(20, 0, 5, 0);
    jpFullPreview.add(tpTabbedView, c);
    return (jpFullPreview);
}

53. HistoryBrowserTabContentPanel#addSpecifiedPanel()

Project: incubator-taverna-workbench
File: HistoryBrowserTabContentPanel.java
private JPanel addSpecifiedPanel(final int id, final String strBoxTitle, JPanel jPanel) {
    JPanel jpTemp = new JPanel();
    jpTemp.setLayout(new BorderLayout());
    jpTemp.add(generateContentBox(strBoxTitle, jPanel), BorderLayout.CENTER);
    JButton bClear = new JButton("Clear " + strBoxTitle, WorkbenchIcons.deleteIcon);
    bClear.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            confirmHistoryDelete(id, strBoxTitle);
        }
    });
    jpTemp.add(bClear, BorderLayout.SOUTH);
    jpTemp.setMinimumSize(new Dimension(500, 0));
    return jpTemp;
}

54. LoopConfigureAction#actionPerformed()

Project: incubator-taverna-workbench
File: LoopConfigureAction.java
public void actionPerformed(ActionEvent e) {
    String title = "Looping for service " + processor.getName();
    final JDialog dialog = new HelpEnabledDialog(owner, title, true);
    LoopConfigurationPanel loopConfigurationPanel = new LoopConfigurationPanel(processor, loopLayer, profile, applicationConfig);
    dialog.add(loopConfigurationPanel, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout());
    JButton okButton = new JButton(new OKAction(dialog, loopConfigurationPanel));
    buttonPanel.add(okButton);
    JButton resetButton = new JButton(new ResetAction(loopConfigurationPanel));
    buttonPanel.add(resetButton);
    JButton cancelButton = new JButton(new CancelAction(dialog));
    buttonPanel.add(cancelButton);
    dialog.add(buttonPanel, BorderLayout.SOUTH);
    dialog.pack();
    dialog.setSize(650, 430);
    dialog.setLocationRelativeTo(null);
    dialog.setVisible(true);
}

55. ConfigForm#createPanel()

Project: chipKIT32-MAX
File: ConfigForm.java
public JPanel createPanel() {
    JPanel jpanel1 = new JPanel();
    FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:3DLU:NONE,FILL:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
    CellConstraints cc = new CellConstraints();
    jpanel1.setLayout(formlayout1);
    _logTextArea.setName("logTextArea");
    JScrollPane jscrollpane1 = new JScrollPane();
    jscrollpane1.setViewportView(_logTextArea);
    jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane1, cc.xy(2, 6));
    _logSeparator.setName("logSeparator");
    _logSeparator.setText(Messages.getString("log"));
    jpanel1.add(_logSeparator, cc.xy(2, 4));
    _tab.setName("tab");
    jpanel1.add(_tab, cc.xywh(1, 2, 3, 1));
    addFillComponents(jpanel1, new int[] { 1, 2, 3 }, new int[] { 1, 3, 4, 5, 6, 7 });
    return jpanel1;
}

56. BuckSettingsUI#init()

Project: buck
File: BuckSettingsUI.java
private void init() {
    setLayout(new BorderLayout());
    JPanel container = this;
    buckPathField = new TextFieldWithBrowseButton();
    FileChooserDescriptor buckFileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false);
    buckPathField.addBrowseFolderListener("", "Buck Executable Path", null, buckFileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT, false);
    adbPathField = new TextFieldWithBrowseButton();
    FileChooserDescriptor adbFileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false);
    adbPathField.addBrowseFolderListener("", "Adb Executable Path", null, adbFileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT, false);
    customizedInstallSettingField = new JBTextField();
    customizedInstallSettingField.getEmptyText().setText(CUSTOMIZED_INSTALL_FLAGS_HINT);
    customizedInstallSettingField.setEnabled(false);
    showDebug = new JCheckBox("Show debug in tool window");
    enableAutoDeps = new JCheckBox("Enable auto dependencies");
    runAfterInstall = new JCheckBox("Run after install (-r)");
    multiInstallMode = new JCheckBox("Multi-install mode (-x)");
    uninstallBeforeInstall = new JCheckBox("Uninstall before installing (-u)");
    customizedInstallSetting = new JCheckBox("Use customized install setting:  ");
    initCustomizedInstallCommandListener();
    JPanel buckSettings = new JPanel(new GridBagLayout());
    buckSettings.setBorder(IdeBorderFactory.createTitledBorder("Buck Settings", true));
    container.add(container = new JPanel(new BorderLayout()), BorderLayout.NORTH);
    container.add(buckSettings, BorderLayout.NORTH);
    final GridBagConstraints constraints = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0);
    buckSettings.add(new JLabel("Buck Executable Path:"), constraints);
    constraints.gridx = 1;
    constraints.weightx = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    buckSettings.add(buckPathField, constraints);
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.weightx = 1;
    buckSettings.add(new JLabel("Adb Executable Path:"), constraints);
    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.weightx = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    buckSettings.add(adbPathField, constraints);
    constraints.gridx = 0;
    constraints.gridy = 2;
    buckSettings.add(showDebug, constraints);
    constraints.gridx = 0;
    constraints.gridy = 3;
    buckSettings.add(enableAutoDeps, constraints);
    JPanel installSettings = new JPanel(new BorderLayout());
    installSettings.setBorder(IdeBorderFactory.createTitledBorder("Buck Install Settings", true));
    container.add(container = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    container.add(installSettings, BorderLayout.NORTH);
    installSettings.add(runAfterInstall, BorderLayout.NORTH);
    installSettings.add(installSettings = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    installSettings.add(multiInstallMode, BorderLayout.NORTH);
    installSettings.add(installSettings = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    installSettings.add(uninstallBeforeInstall, BorderLayout.NORTH);
    installSettings.add(installSettings = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    final GridBagConstraints customConstraints = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0);
    JPanel customizedInstallSetting = new JPanel(new GridBagLayout());
    customizedInstallSetting.add(this.customizedInstallSetting, customConstraints);
    customConstraints.gridx = 1;
    customConstraints.weightx = 1;
    customConstraints.fill = GridBagConstraints.HORIZONTAL;
    customizedInstallSetting.add(customizedInstallSettingField, customConstraints);
    installSettings.add(customizedInstallSetting, BorderLayout.NORTH);
}

57. CStandardEditPanel#addNameDatesPanel()

Project: binnavi
File: CStandardEditPanel.java
/**
   * Creates the panel where the name text field and the creation date and modification date labels
   * are located.
   * 
   * @param headline Headline to be shown in the border of this panel.
   * @param name Provides information for the name field.
   * @param creationDate Provides information for the creation date field.
   * @param modificationDate Provides information for the modification date field.
   */
private void addNameDatesPanel(final String headline, final IFieldDescription<String> name, final IFieldDescription<Date> creationDate, final IFieldDescription<Date> modificationDate) {
    final JPanel nameDatesPanel = new JPanel(new GridLayout(3, 1, 5, 5));
    nameDatesPanel.setBorder(new TitledBorder(headline));
    nameDatesPanel.add(new CLabeledComponent("Name" + ":", name.getHelp(), m_nameTextField));
    nameDatesPanel.add(new CLabeledComponent("Creation Date" + ":", creationDate.getHelp(), m_creationDateValueLabel));
    nameDatesPanel.add(new CLabeledComponent("Modification Date" + ":", modificationDate.getHelp(), m_modificationDateValueLabel));
    add(nameDatesPanel, BorderLayout.NORTH);
}

58. CTagNodeComponent#createGui()

Project: binnavi
File: CTagNodeComponent.java
/**
   * Creates the GUI of the component.
   */
private void createGui() {
    final JPanel outerNamePanel = new JPanel(new BorderLayout());
    outerNamePanel.setBorder(new TitledBorder("Tag"));
    final JPanel namePanel = new JPanel(new BorderLayout());
    namePanel.setBorder(new EmptyBorder(0, 0, 5, 0));
    final JLabel nameLabel = new CHelpLabel("Name" + ":", new CNameHelp());
    nameLabel.setPreferredSize(new Dimension(110, 25));
    namePanel.add(nameLabel, BorderLayout.WEST);
    namePanel.add(m_nameTextField, BorderLayout.CENTER);
    outerNamePanel.add(namePanel, BorderLayout.CENTER);
    final JPanel outerDescriptionPanel = new JPanel(new BorderLayout());
    outerDescriptionPanel.setBorder(new EmptyBorder(5, 0, 0, 0));
    final JPanel descriptionPanel = new JPanel(new BorderLayout());
    descriptionPanel.setBorder(new TitledBorder("Description"));
    descriptionPanel.setMinimumSize(new Dimension(0, 120));
    descriptionPanel.add(new JScrollPane(m_descriptionField));
    outerDescriptionPanel.add(descriptionPanel, BorderLayout.CENTER);
    final JPanel buttonPanel = new JPanel(new GridLayout(1, 2));
    buttonPanel.add(new JPanel());
    buttonPanel.setBorder(new EmptyBorder(5, 0, 5, 2));
    buttonPanel.add(m_saveButton);
    final JPanel topPanel = new JPanel(new BorderLayout());
    topPanel.add(outerNamePanel, BorderLayout.NORTH);
    topPanel.add(outerDescriptionPanel, BorderLayout.CENTER);
    topPanel.add(buttonPanel, BorderLayout.SOUTH);
    final JPanel bottomPanel = new JPanel(new BorderLayout());
    bottomPanel.setBorder(m_tableBorder);
    final JScrollPane scrollPane = new JScrollPane(m_childrenTagTable);
    bottomPanel.add(scrollPane, BorderLayout.CENTER);
    final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, topPanel, bottomPanel);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(splitPane.getMinimumDividerLocation());
    splitPane.setResizeWeight(0.5);
    add(splitPane);
}

59. CCriteriaDialog#initDialog()

Project: binnavi
File: CCriteriaDialog.java
/**
   * Creates the GUI of the dialog.
   *
   * @param jtree Tree component shown in the dialog.
   * @param selectionBox Used to select new criteria.
   * @param defineConditionPanel Panel where the condition is shown.
   * @param okCancelPanel Panel that contains the OK and Cancel buttons.
   * @param addConditionButton Add Condition button.
   */
private void initDialog(final JCriteriumTree jtree, final CConditionBox selectionBox, final JPanel defineConditionPanel, final CPanelTwoButtons okCancelPanel, final JButton addConditionButton) {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    final JPanel deviderBorderPanel = new JPanel(new BorderLayout());
    // (""));
    deviderBorderPanel.setBorder(new EmptyBorder(2, 2, 2, 2));
    final JPanel deviderPanel = new JPanel(new GridLayout(1, 2));
    final JPanel leftPanel = new JPanel(new BorderLayout());
    leftPanel.setBorder(new TitledBorder("Expression Tree"));
    final JPanel rightPanel = new JPanel(new BorderLayout());
    final JPanel rightTopPanel = new JPanel(new BorderLayout());
    rightTopPanel.setBorder(new TitledBorder("Create Condition"));
    final JPanel rightTopComboPanel = new JPanel(new BorderLayout());
    rightTopComboPanel.setBorder(new EmptyBorder(1, 5, 5, 5));
    final JPanel rightTopAddPanel = new JPanel(new BorderLayout());
    rightTopAddPanel.setBorder(new EmptyBorder(1, 0, 5, 5));
    mainPanel.add(deviderBorderPanel, BorderLayout.CENTER);
    mainPanel.add(okCancelPanel, BorderLayout.SOUTH);
    okCancelPanel.getFirstButton().setEnabled(jtree.getSelectionPath() != null);
    deviderBorderPanel.add(deviderPanel, BorderLayout.CENTER);
    deviderPanel.add(leftPanel);
    deviderPanel.add(rightPanel);
    final JScrollPane pane = new JScrollPane(jtree);
    pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    leftPanel.add(pane, BorderLayout.CENTER);
    defineConditionPanel.setBorder(new TitledBorder("Define Condition"));
    rightPanel.add(rightTopPanel, BorderLayout.NORTH);
    rightPanel.add(defineConditionPanel, BorderLayout.CENTER);
    rightTopPanel.add(rightTopComboPanel, BorderLayout.CENTER);
    rightTopPanel.add(rightTopAddPanel, BorderLayout.EAST);
    rightTopComboPanel.add(selectionBox, BorderLayout.CENTER);
    addConditionButton.setText("Add");
    addConditionButton.setEnabled(false);
    rightTopAddPanel.add(addConditionButton, BorderLayout.CENTER);
    add(mainPanel);
    setIconImage(null);
    pack();
}

60. DemoModule#createHorizontalPanel()

Project: beautyeye
File: DemoModule.java
/**
     * Creates the horizontal panel.
     *
     * @param threeD the three d
     * @return the j panel
     */
public JPanel createHorizontalPanel(boolean threeD) {
    //modified by jb2011
    JPanel p = N9ComponentFactory.createPanel_style1(null).setDrawBg(threeD);
    p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
    p.setAlignmentY(TOP_ALIGNMENT);
    p.setAlignmentX(LEFT_ALIGNMENT);
    if (threeD) {
        p.setBorder(loweredBorder);
    }
    //??????N9?????????????????????????????????
    //add by jb2011 2012-08-24
    p.setOpaque(false);
    return p;
}

61. AgeCalculator#addMainArea()

Project: joda-time
File: AgeCalculator.java
private void addMainArea(Container container) {
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    addTopArea(panel);
    panel.add(Box.createVerticalStrut(10));
    addBottomArea(panel);
    panel.add(Box.createVerticalGlue());
    panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    container.add(panel);
}

62. DefaultValueAxisEditor#createTickUnitPanel()

Project: jfreechart-fse
File: DefaultValueAxisEditor.java
protected JPanel createTickUnitPanel() {
    JPanel tickUnitPanel = new JPanel(new LCBLayout(3));
    tickUnitPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    tickUnitPanel.add(new JPanel());
    this.autoTickUnitSelectionCheckBox = new JCheckBox(localizationResources.getString("Auto-TickUnit_Selection"), this.autoTickUnitSelection);
    this.autoTickUnitSelectionCheckBox.setActionCommand("AutoTickOnOff");
    this.autoTickUnitSelectionCheckBox.addActionListener(this);
    tickUnitPanel.add(this.autoTickUnitSelectionCheckBox);
    tickUnitPanel.add(new JPanel());
    return tickUnitPanel;
}

63. ACMPortalFetcher#getOptionsPanel()

Project: jabref
File: ACMPortalFetcher.java
@Override
public JPanel getOptionsPanel() {
    JPanel pan = new JPanel();
    pan.setLayout(new GridLayout(0, 1));
    guideButton.setSelected(true);
    ButtonGroup group = new ButtonGroup();
    group.add(acmButton);
    group.add(guideButton);
    pan.add(absCheckBox);
    pan.add(acmButton);
    pan.add(guideButton);
    return pan;
}

64. Times#addField()

Project: tomighty
File: Times.java
private JFormattedTextField addField(String name) {
    JFormattedTextField field = FieldFactory.createIntegerField(1, 2);
    JLabel label = new JLabel(messages.get(name), JLabel.TRAILING);
    label.setLabelFor(field);
    JPanel panel = new JPanel();
    panel.setLayout(new GridLayout(1, 3, 5, 5));
    panel.add(label);
    panel.add(field);
    panel.add(new JLabel(messages.get("minutes")));
    add(panel);
    return field;
}

65. AgentFrame#initComponent()

Project: reader
File: AgentFrame.java
/**
     * Initialize UI components.
     */
private void initComponent() {
    tabbedPane = new JTabbedPane();
    closeButton = new JButton("Close");
    closeButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            setVisible(false);
        }
    });
    tabbedPane.add(MessageUtil.getMessage("agent.frame.pane.status"), statusPanel);
    tabbedPane.add(MessageUtil.getMessage("agent.frame.pane.setting"), settingPanel);
    JPanel pane = (JPanel) getContentPane();
    pane.setLayout(new BorderLayout(10, 10));
    pane.add(tabbedPane, BorderLayout.CENTER);
    pane.add(ButtonBarFactory.buildCloseBar(closeButton), BorderLayout.SOUTH);
    pane.setBorder(Borders.TABBED_DIALOG_BORDER);
}

66. StreamImageView#initUI()

Project: pdfbox
File: StreamImageView.java
private void initUI() {
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    zoomMenu = ZoomMenu.getInstance();
    zoomMenu.changeZoomSelection(zoomMenu.getImageZoomScale());
    label = new JLabel();
    label.setBorder(new LineBorder(Color.BLACK));
    label.setAlignmentX(Component.CENTER_ALIGNMENT);
    addImage(zoomImage(image, zoomMenu.getImageZoomScale(), RotationMenu.getRotationDegrees()));
    panel.add(Box.createVerticalGlue());
    panel.add(label);
    panel.add(Box.createVerticalGlue());
    scrollPane = new JScrollPane();
    scrollPane.setPreferredSize(new Dimension(300, 400));
    scrollPane.addAncestorListener(this);
    scrollPane.setViewportView(panel);
}

67. SolverAndPersistenceFrame#createScorePanel()

Project: optaplanner
File: SolverAndPersistenceFrame.java
private JPanel createScorePanel() {
    JPanel scorePanel = new JPanel(new BorderLayout(5, 0));
    scorePanel.setBorder(BorderFactory.createEtchedBorder());
    showConstraintMatchesDialogAction = new ShowConstraintMatchesDialogAction();
    showConstraintMatchesDialogAction.setEnabled(false);
    scorePanel.add(new JButton(showConstraintMatchesDialogAction), BorderLayout.WEST);
    scoreField = new JTextField("Score:");
    scoreField.setEditable(false);
    scoreField.setForeground(Color.BLACK);
    scoreField.setBorder(BorderFactory.createLoweredBevelBorder());
    scorePanel.add(scoreField, BorderLayout.CENTER);
    refreshScreenDuringSolvingCheckBox = new JCheckBox("Refresh screen during solving", solutionPanel.isRefreshScreenDuringSolving());
    scorePanel.add(refreshScreenDuringSolvingCheckBox, BorderLayout.EAST);
    return scorePanel;
}

68. OptaPlannerExamplesApp#createExtraPanel()

Project: optaplanner
File: OptaPlannerExamplesApp.java
private JPanel createExtraPanel() {
    JPanel extraPanel = new JPanel(new GridLayout(0, 1, 5, 5));
    extraPanel.add(new JPanel());
    webExamplesDialog = new WebExamplesDialog();
    Action webExamplesAction = new AbstractAction("Show web examples") {

        @Override
        public void actionPerformed(ActionEvent event) {
            webExamplesDialog.setLocationRelativeTo(OptaPlannerExamplesApp.this);
            webExamplesDialog.setVisible(true);
        }
    };
    extraPanel.add(new JButton(webExamplesAction));
    Action homepageAction = new OpenBrowserAction("www.optaplanner.org", "http://www.optaplanner.org");
    extraPanel.add(new JButton(homepageAction));
    Action documentationAction = new OpenBrowserAction("Documentation", "http://www.optaplanner.org/learn/documentation.html");
    extraPanel.add(new JButton(documentationAction));
    return extraPanel;
}

69. bug8136998#setupUI()

Project: openjdk
File: bug8136998.java
private void setupUI() {
    frame = new JFrame();
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    comboBox = new JComboBox<>(ITEMS);
    JPanel scrollable = new JPanel();
    scrollable.setLayout(new BoxLayout(scrollable, BoxLayout.Y_AXIS));
    scrollable.add(Box.createVerticalStrut(200));
    scrollable.add(comboBox);
    scrollable.add(Box.createVerticalStrut(200));
    scrollPane = new JScrollPane(scrollable);
    frame.add(scrollPane);
    frame.setSize(100, 200);
    frame.setVisible(true);
}

70. JobAttrUpdateTest#doTest()

Project: openjdk
File: JobAttrUpdateTest.java
private static void doTest(Runnable action) {
    String description = " A print dialog will be shown.\n " + " Please select Pages within Page-range.\n" + " and enter From 2 and To 3. Then Select OK.";
    final JDialog dialog = new JDialog();
    dialog.setTitle("JobAttribute Updation Test");
    JTextArea textArea = new JTextArea(description);
    textArea.setEditable(false);
    final JButton testButton = new JButton("Start Test");
    testButton.addActionListener(( e) -> {
        testButton.setEnabled(false);
        action.run();
    });
    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(textArea, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(testButton);
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    dialog.add(mainPanel);
    dialog.pack();
    dialog.setVisible(true);
}

71. DefaultPropView#getInstanceClassPanel()

Project: oodt
File: DefaultPropView.java
private JPanel getInstanceClassPanel(final ModelGraph graph, final ViewState state) {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.setBorder(new EtchedBorder());
    panel.add(new JLabel("InstanceClass:"), BorderLayout.NORTH);
    JTextField field = new JTextField(graph.getModel().getInstanceClass(), 50);
    field.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            if (graph.getModel().getInstanceClass() == null || !graph.getModel().getInstanceClass().equals(e.getActionCommand())) {
                graph.getModel().setInstanceClass(e.getActionCommand());
                DefaultPropView.this.notifyListeners();
                DefaultPropView.this.refreshView(state);
            }
        }
    });
    panel.add(field, BorderLayout.CENTER);
    return panel;
}

72. DefaultPropView#getModelNamePanel()

Project: oodt
File: DefaultPropView.java
private JPanel getModelNamePanel(final ModelGraph graph, final ViewState state) {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.setBorder(new EtchedBorder());
    panel.add(new JLabel("ModelName:"), BorderLayout.NORTH);
    JTextField field = new JTextField(graph.getModel().getModelName(), 50);
    field.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            if (!graph.getModel().getModelName().equals(e.getActionCommand())) {
                graph.getModel().setModelName(e.getActionCommand());
                DefaultPropView.this.notifyListeners();
                DefaultPropView.this.refreshView(state);
            }
        }
    });
    panel.add(field, BorderLayout.CENTER);
    return panel;
}

73. DefaultPropView#getModelIdPanel()

Project: oodt
File: DefaultPropView.java
private JPanel getModelIdPanel(final ModelGraph graph, final ViewState state) {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.setBorder(new EtchedBorder());
    panel.add(new JLabel("ModelId:"), BorderLayout.NORTH);
    JTextField field = new JTextField(graph.getModel().getModelId(), 50);
    field.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            if (!graph.getModel().getModelId().equals(e.getActionCommand())) {
                GuiUtils.updateGraphModelId(state, graph.getModel().getId(), e.getActionCommand());
                DefaultPropView.this.notifyListeners();
                DefaultPropView.this.refreshView(state);
            }
        }
    });
    panel.add(field, BorderLayout.CENTER);
    return panel;
}

74. DefaultPropView#getTimeout()

Project: oodt
File: DefaultPropView.java
private JPanel getTimeout(final ModelGraph graph, final ViewState state) {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.setBorder(new EtchedBorder());
    panel.add(new JLabel("Timeout:"), BorderLayout.NORTH);
    JTextField field = new JTextField(String.valueOf(graph.getModel().getTimeout()), 50);
    field.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            if (!graph.getModel().getModelId().equals(e.getActionCommand())) {
                graph.getModel().setTimeout(Long.valueOf(e.getActionCommand() != null && !e.getActionCommand().equals("") ? e.getActionCommand() : "-1"));
                DefaultPropView.this.notifyListeners();
                DefaultPropView.this.refreshView(state);
            }
        }
    });
    panel.add(field, BorderLayout.CENTER);
    return panel;
}

75. Converter_Multipass#convert()

Project: Makelangelo
File: Converter_Multipass.java
/**
	 * create horizontal lines across the image.  Raise and lower the pen to darken the appropriate areas
	 *
	 * @param img the image to convert.
	 */
@Override
public boolean convert(TransformedImage img, Writer out) throws IOException {
    final JTextField angleField = new JTextField(Float.toString(angle));
    final JTextField passesField = new JTextField(Integer.toString(passes));
    JPanel panel = new JPanel(new GridLayout(0, 1));
    panel.add(new JLabel(Translator.get("Multipass Angle")));
    panel.add(angleField);
    panel.add(new JLabel(Translator.get("Multipass Levels")));
    panel.add(passesField);
    int result = JOptionPane.showConfirmDialog(null, panel, getName(), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
    if (result == JOptionPane.OK_OPTION) {
        angle = Float.parseFloat(angleField.getText());
        passes = Integer.parseInt(passesField.getText());
        if (passes <= 2)
            passes = 2;
        return convertNow(img, out);
    }
    return false;
}

76. InstallerGUI#buildJavacArea()

Project: lombok
File: InstallerGUI.java
private Component buildJavacArea() {
    JPanel container = new JPanel();
    container.setLayout(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.anchor = GridBagConstraints.WEST;
    constraints.insets = new Insets(8, 0, 0, 16);
    container.add(new JLabel(JAVAC_TITLE), constraints);
    constraints.gridy = 1;
    constraints.weightx = 1.0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    container.add(new JLabel(JAVAC_EXPLANATION), constraints);
    JLabel example = new JLabel(JAVAC_EXAMPLE);
    constraints.gridy = 2;
    container.add(example, constraints);
    return container;
}

77. ProcGui#createProcEditPane()

Project: h-store
File: ProcGui.java
private JPanel createProcEditPane() {
    JPanel paneSpEdit = new JPanel();
    paneSpEdit.setLayout(null);
    int nXStart = m_scrollProcNames.getWidth() + GuiConstants.GAP_COMPONENT;
    int nWidth = m_paneParent.getWidth() - m_scrollProcNames.getWidth() - GuiConstants.GAP_COMPONENT;
    paneSpEdit.setBounds(nXStart, 0, nWidth, m_scrollProcNames.getHeight());
    paneSpEdit.add(createProcProbabilityPane(paneSpEdit));
    paneSpEdit.add(createProcParasPane(paneSpEdit));
    return paneSpEdit;
}

78. ProcGui#addProcedureViewEditPane()

Project: h-store
File: ProcGui.java
private void addProcedureViewEditPane() {
    JPanel paneSp = new JPanel();
    paneSp.setLayout(null);
    int nWidth = m_paneParent.getWidth();
    int nHeight = m_paneParent.getHeight() - m_paneButtons.getHeight() - 3 * GuiConstants.GAP_COMPONENT;
    paneSp.setBounds(0, m_paneButtons.getHeight(), nWidth, nHeight);
    m_scrollProcNames = new LHSListPane(paneSp, m_lstProcNames);
    paneSp.add(m_scrollProcNames);
    paneSp.add(createProcEditPane());
    add(paneSp);
}

79. EclipsePluginsStep#init()

Project: eclim
File: EclipsePluginsStep.java
@Override
public Component init() {
    theme = new DesertBlue();
    stepPanel = (JPanel) super.init();
    stepPanel.setBorder(null);
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
    messageLabel = new JLabel();
    messageLabel.setPreferredSize(new Dimension(25, 25));
    panel.add(messageLabel);
    panel.add(stepPanel);
    panel.setBorder(BorderFactory.createEmptyBorder(25, 25, 10, 25));
    return panel;
}

80. DefaultLogAxisEditor#createTickUnitPanel()

Project: jfreechart-fse
File: DefaultLogAxisEditor.java
@Override
protected JPanel createTickUnitPanel() {
    JPanel tickUnitPanel = super.createTickUnitPanel();
    tickUnitPanel.add(new JLabel(localizationResources.getString("Manual_TickUnit_value")));
    this.manualTickUnit = new JTextField(Double.toString(this.manualTickUnitValue));
    this.manualTickUnit.setEnabled(!isAutoTickUnitSelection());
    this.manualTickUnit.setActionCommand("TickUnitValue");
    this.manualTickUnit.addActionListener(this);
    this.manualTickUnit.addFocusListener(this);
    tickUnitPanel.add(this.manualTickUnit);
    tickUnitPanel.add(new JPanel());
    return tickUnitPanel;
}

81. bug4337267#createContentPane()

Project: jdk7u-jdk
File: bug4337267.java
Component createContentPane() {
    Dimension size = new Dimension(500, 100);
    i1 = new TestBufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB);
    i2 = new TestBufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB);
    p1 = new TestJPanel();
    p1.setPreferredSize(size);
    p2 = new TestJPanel();
    p2.setPreferredSize(size);
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    panel.add(p1);
    panel.add(p2);
    return panel;
}

82. ProcessInstanceExecutorFrame#initializeComponent()

Project: jbpm
File: ProcessInstanceExecutorFrame.java
private void initializeComponent() {
    JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());
    getRootPane().setLayout(new BorderLayout());
    getRootPane().add(panel, BorderLayout.CENTER);
    processIdTextField = new JTextField("com.sample.ruleflow");
    GridBagConstraints c = new GridBagConstraints();
    c.weightx = 1;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(5, 5, 5, 5);
    panel.add(processIdTextField, c);
    startButton = new JButton("Start");
    startButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent event) {
            start();
        }
    });
    c = new GridBagConstraints();
    c.gridy = 1;
    c.anchor = GridBagConstraints.EAST;
    c.insets = new Insets(5, 5, 5, 5);
    panel.add(startButton, c);
}

83. CasAnnotationViewer#createViewModePanel()

Project: uima-uimaj
File: CasAnnotationViewer.java
private JPanel createViewModePanel() {
    JPanel viewModePanel = new JPanel();
    viewModePanel.add(new JLabel("Mode: "));
    this.createAnnotationModeButton();
    viewModePanel.add(this.annotationModeButton);
    //    this.createEntityModeButton();
    //    viewModePanel.add(this.entityModeButton);
    this.createFeatureModeButton();
    viewModePanel.add(this.featureModeButton);
    ButtonGroup group = new ButtonGroup();
    group.add(this.annotationModeButton);
    //    group.add(this.entityModeButton);
    group.add(this.featureModeButton);
    return viewModePanel;
}

84. AnnotationDisplayCustomizationFrame#createColorPanel()

Project: uima-uimaj
File: AnnotationDisplayCustomizationFrame.java
private JPanel createColorPanel(String text, ColorIcon icon, int buttonType) {
    JPanel colorPanel = new JPanel();
    JLabel label = new JLabel(text);
    colorPanel.add(label);
    label = new JLabel(icon);
    colorPanel.add(label);
    JButton button = new JButton("Customize");
    if (buttonType == FG) {
        button.addActionListener(new CustomizeFgButtonHandler());
    } else {
        button.addActionListener(new CustomizeBgButtonHandler());
    }
    colorPanel.add(button);
    return colorPanel;
}

85. FFTZoomGeneralizedGoertzel#createGainPanel()

Project: TarsosDSP
File: FFTZoomGeneralizedGoertzel.java
private JComponent createGainPanel() {
    JSlider gainSlider;
    gainSlider = new JSlider(0, 200);
    gainSlider.setValue(100);
    gainSlider.setPaintLabels(true);
    gainSlider.setPaintTicks(true);
    final JLabel label = new JLabel("Gain: 100%");
    gainSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent arg0) {
            JSlider gainSlider = ((JSlider) arg0.getSource());
            double gainValue = gainSlider.getValue() / 100.0;
            label.setText(String.format("Gain: %3d", gainSlider.getValue()) + "%");
            player.setGain(gainValue);
        }
    });
    JPanel gainPanel = new JPanel(new BorderLayout());
    label.setToolTipText("Volume in % (100 is no change).");
    gainPanel.add(label, BorderLayout.NORTH);
    gainPanel.add(gainSlider, BorderLayout.CENTER);
    gainPanel.setBorder(new TitledBorder("Volume control"));
    return gainPanel;
}

86. HaarWaveletAudioCompression#createBitDepthCompressionPanel()

Project: TarsosDSP
File: HaarWaveletAudioCompression.java
private JComponent createBitDepthCompressionPanel(int maxValue) {
    final JSlider bitDepthcompressionSlider = new JSlider(0, maxValue);
    bitDepthcompressionSlider.setValue(maxValue);
    bitDepthcompressionSlider.setPaintLabels(true);
    bitDepthcompressionSlider.setPaintTicks(true);
    final JLabel label = new JLabel("Bit depth (bits): " + maxValue);
    bitDepthcompressionSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent arg0) {
            int bitDepth = bitDepthcompressionSlider.getValue();
            label.setText(String.format("Bit depth (bits): %3d", bitDepth));
            if (bithDeptProcessor != null)
                bithDeptProcessor.setBitDepth(bitDepth);
        }
    });
    JPanel compressionPanel = new JPanel(new BorderLayout());
    label.setToolTipText("Bit depth in bits.");
    compressionPanel.add(label, BorderLayout.NORTH);
    compressionPanel.add(bitDepthcompressionSlider, BorderLayout.CENTER);
    compressionPanel.setBorder(new TitledBorder("Bith depth control"));
    return compressionPanel;
}

87. HaarWaveletAudioCompression#createCompressionPanel()

Project: TarsosDSP
File: HaarWaveletAudioCompression.java
private JComponent createCompressionPanel() {
    final JSlider compressionSlider = new JSlider(0, 31);
    compressionSlider.setValue(10);
    compressionSlider.setPaintLabels(true);
    compressionSlider.setPaintTicks(true);
    final JLabel label = new JLabel("Compression: 10");
    compressionSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent arg0) {
            int compressionValue = compressionSlider.getValue();
            label.setText(String.format("Compression: %3d", compressionValue));
            if (coder != null)
                coder.setCompression(compressionValue);
        }
    });
    JPanel compressionPanel = new JPanel(new BorderLayout());
    label.setToolTipText("Compression in steps (0 is no compression, 32 is no signal).");
    compressionPanel.add(label, BorderLayout.NORTH);
    compressionPanel.add(compressionSlider, BorderLayout.CENTER);
    compressionPanel.setBorder(new TitledBorder("Compression control"));
    return compressionPanel;
}

88. HaarWaveletAudioCompression#createGainPanel()

Project: TarsosDSP
File: HaarWaveletAudioCompression.java
private JComponent createGainPanel() {
    final JSlider gainSlider;
    gainSlider = new JSlider(0, 200);
    gainSlider.setValue(100);
    gainSlider.setPaintLabels(true);
    gainSlider.setPaintTicks(true);
    final JLabel label = new JLabel("Gain: 100%");
    gainSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent arg0) {
            double gainValue = gainSlider.getValue() / 100.0;
            label.setText(String.format("Gain: %3d", gainSlider.getValue()) + "%");
            if (gain != null)
                gain.setGain(gainValue);
        }
    });
    JPanel gainPanel = new JPanel(new BorderLayout());
    label.setToolTipText("Volume in % (100 is no change).");
    gainPanel.add(label, BorderLayout.NORTH);
    gainPanel.add(gainSlider, BorderLayout.CENTER);
    gainPanel.setBorder(new TitledBorder("Volume control"));
    return gainPanel;
}

89. Daubechies4WaveletAudioCompression#createBitDepthCompressionPanel()

Project: TarsosDSP
File: Daubechies4WaveletAudioCompression.java
private JComponent createBitDepthCompressionPanel(int maxValue) {
    final JSlider bitDepthcompressionSlider = new JSlider(0, maxValue);
    bitDepthcompressionSlider.setValue(maxValue);
    bitDepthcompressionSlider.setPaintLabels(true);
    bitDepthcompressionSlider.setPaintTicks(true);
    final JLabel label = new JLabel("Bit depth (bits): " + maxValue);
    bitDepthcompressionSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent arg0) {
            int bitDepth = bitDepthcompressionSlider.getValue();
            label.setText(String.format("Bit depth (bits): %3d", bitDepth));
            if (bithDeptProcessor != null)
                bithDeptProcessor.setBitDepth(bitDepth);
        }
    });
    JPanel compressionPanel = new JPanel(new BorderLayout());
    label.setToolTipText("Bit depth in bits.");
    compressionPanel.add(label, BorderLayout.NORTH);
    compressionPanel.add(bitDepthcompressionSlider, BorderLayout.CENTER);
    compressionPanel.setBorder(new TitledBorder("Bith depth control"));
    return compressionPanel;
}

90. Daubechies4WaveletAudioCompression#createCompressionPanel()

Project: TarsosDSP
File: Daubechies4WaveletAudioCompression.java
private JComponent createCompressionPanel() {
    final JSlider compressionSlider = new JSlider(0, 31);
    compressionSlider.setValue(10);
    compressionSlider.setPaintLabels(true);
    compressionSlider.setPaintTicks(true);
    final JLabel label = new JLabel("Compression: 10");
    compressionSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent arg0) {
            int compressionValue = compressionSlider.getValue();
            label.setText(String.format("Compression: %3d", compressionValue));
            if (coder != null)
                coder.setCompression(compressionValue);
        }
    });
    JPanel compressionPanel = new JPanel(new BorderLayout());
    label.setToolTipText("Compression in steps (0 is no compression, 32 is no signal).");
    compressionPanel.add(label, BorderLayout.NORTH);
    compressionPanel.add(compressionSlider, BorderLayout.CENTER);
    compressionPanel.setBorder(new TitledBorder("Compression control"));
    return compressionPanel;
}

91. Daubechies4WaveletAudioCompression#createGainPanel()

Project: TarsosDSP
File: Daubechies4WaveletAudioCompression.java
private JComponent createGainPanel() {
    final JSlider gainSlider;
    gainSlider = new JSlider(0, 200);
    gainSlider.setValue(100);
    gainSlider.setPaintLabels(true);
    gainSlider.setPaintTicks(true);
    final JLabel label = new JLabel("Gain: 100%");
    gainSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent arg0) {
            double gainValue = gainSlider.getValue() / 100.0;
            label.setText(String.format("Gain: %3d", gainSlider.getValue()) + "%");
            if (gain != null)
                gain.setGain(gainValue);
        }
    });
    JPanel gainPanel = new JPanel(new BorderLayout());
    label.setToolTipText("Volume in % (100 is no change).");
    gainPanel.add(label, BorderLayout.NORTH);
    gainPanel.add(gainSlider, BorderLayout.CENTER);
    gainPanel.setBorder(new TitledBorder("Volume control"));
    return gainPanel;
}

92. ConstantQAudioPlayer#createGainPanel()

Project: TarsosDSP
File: ConstantQAudioPlayer.java
private JComponent createGainPanel() {
    gainSlider = new JSlider(0, 200);
    gainSlider.setValue(100);
    gainSlider.setPaintLabels(true);
    gainSlider.setPaintTicks(true);
    final JLabel label = new JLabel("Gain: 100%");
    gainSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent arg0) {
            double gainValue = gainSlider.getValue() / 100.0;
            label.setText(String.format("Gain: %3d", gainSlider.getValue()) + "%");
            player.setGain(gainValue);
        }
    });
    JPanel gainPanel = new JPanel(new BorderLayout());
    label.setToolTipText("Volume in % (100 is no change).");
    gainPanel.add(label, BorderLayout.NORTH);
    gainPanel.add(gainSlider, BorderLayout.CENTER);
    gainPanel.setBorder(new TitledBorder("Volume control"));
    return gainPanel;
}

93. AdvancedAudioPlayer#createGainPanel()

Project: TarsosDSP
File: AdvancedAudioPlayer.java
private JComponent createGainPanel() {
    gainSlider = new JSlider(0, 200);
    gainSlider.setValue(100);
    gainSlider.setPaintLabels(true);
    gainSlider.setPaintTicks(true);
    final JLabel label = new JLabel("Gain: 100%");
    gainSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent arg0) {
            double gainValue = gainSlider.getValue() / 100.0;
            label.setText(String.format("Gain: %3d", gainSlider.getValue()) + "%");
            player.setGain(gainValue);
        }
    });
    JPanel gainPanel = new JPanel(new BorderLayout());
    label.setToolTipText("Volume in % (100 is no change).");
    gainPanel.add(label, BorderLayout.NORTH);
    gainPanel.add(gainSlider, BorderLayout.CENTER);
    gainPanel.setBorder(new TitledBorder("Volume control"));
    return gainPanel;
}

94. AdvancedAudioPlayer#createTempoPanel()

Project: TarsosDSP
File: AdvancedAudioPlayer.java
private JComponent createTempoPanel() {
    tempoSlider = new JSlider(0, 300);
    tempoSlider.setValue(100);
    final JLabel label = new JLabel("Tempo: 100%");
    tempoSlider.setPaintLabels(true);
    tempoSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent arg0) {
            double newTempo = tempoSlider.getValue() / 100.0;
            label.setText(String.format("Tempo: %3d", tempoSlider.getValue()) + "%");
            player.setTempo(newTempo);
        }
    });
    JPanel panel = new JPanel(new BorderLayout());
    label.setToolTipText("The time stretching factor in % (100 is no change).");
    panel.add(label, BorderLayout.NORTH);
    panel.add(tempoSlider, BorderLayout.CENTER);
    panel.setBorder(new TitledBorder("Tempo control"));
    return panel;
}

95. About#initialize()

Project: pGraph
File: About.java
/**
	 * This method initializes this
	 * 
	 * @return void
	 */
private void initialize() {
    JPanel p;
    JLabel l;
    JTextArea jt;
    JPanel contentPanel = new JPanel();
    contentPanel.setLayout(new BorderLayout());
    contentPanel.setBackground(Color.white);
    // Title Panel
    p = new JPanel();
    p.setLayout(new BorderLayout());
    p.setBackground(contentPanel.getBackground());
    l = new JLabel("pGraph");
    l.setFont(new Font("Serif", Font.BOLD, 22));
    l.setHorizontalTextPosition(SwingConstants.CENTER);
    l.setHorizontalAlignment(SwingConstants.CENTER);
    l.setForeground(Color.black);
    p.add(l, BorderLayout.CENTER);
    l = new JLabel(Viewer.version);
    l.setFont(new Font("Serif", Font.BOLD, 16));
    l.setHorizontalTextPosition(SwingConstants.CENTER);
    l.setHorizontalAlignment(SwingConstants.CENTER);
    l.setForeground(Color.black);
    p.add(l, BorderLayout.SOUTH);
    contentPanel.add(p, BorderLayout.NORTH);
    // Description Panel
    p = new JPanel();
    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
    p.setBackground(contentPanel.getBackground());
    p.add(Box.createVerticalGlue());
    jt = new JTextArea("\n" + "  pGraph is capable of producing data graphs either interactively or in batch mode reading the\n" + "  following input files:\n" + "   >  nmon\n" + "   >  vmstat -t\n" + "   >  topasout <xmwlm file>\n" + "   >  topasout <topascec file>\n" + "   >  iostat -alDT\n" + "   >  sar -A\n" + "   >  HMC's lslparutil\n");
    jt.setEditable(false);
    jt.setFont(new Font("Serif", Font.PLAIN, 14));
    jt.setMaximumSize(new Dimension(800, 600));
    jt.setAlignmentX(0.0f);
    jt.setBackground(p.getBackground());
    p.add(jt);
    l = new JLabel(" ");
    l.setFont(new Font("Serif", Font.PLAIN, 14));
    p.add(l);
    jt = new JTextArea("  For additional information:\n" + "  web:       http://tinyurl.com/fed-pgraph\n" + "  email:     [email protected]\n");
    jt.setEditable(false);
    jt.setFont(new Font("Serif", Font.PLAIN, 14));
    jt.setMaximumSize(new Dimension(800, 70));
    jt.setAlignmentX(0.0f);
    jt.setBackground(p.getBackground());
    p.add(jt);
    p.add(Box.createVerticalGlue());
    contentPanel.add(p, BorderLayout.CENTER);
    // Close button
    p = new JPanel();
    p.setLayout(new BorderLayout());
    p.setBackground(contentPanel.getBackground());
    JButton b = new JButton();
    b.setMaximumSize(new Dimension(70, 60));
    b.setText("OK");
    b.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            dispose();
        }
    });
    p.add(b, BorderLayout.CENTER);
    contentPanel.add(p, BorderLayout.SOUTH);
    setSize(800, 500);
    setContentPane(contentPanel);
    setTitle("About pGraph");
}

96. EnvironmentVarsForm#createPanel()

Project: chipKIT32-MAX
File: EnvironmentVarsForm.java
public JPanel createPanel() {
    JPanel jpanel1 = new JPanel();
    FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:9DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
    CellConstraints cc = new CellConstraints();
    jpanel1.setLayout(formlayout1);
    _envVarsTextArea.setName("envVarsTextArea");
    JScrollPane jscrollpane1 = new JScrollPane();
    jscrollpane1.setViewportView(_envVarsTextArea);
    jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane1, cc.xy(4, 2));
    _envVarsLabel.setName("envVarsLabel");
    _envVarsLabel.setText(Messages.getString("setVariables"));
    jpanel1.add(_envVarsLabel, new CellConstraints(2, 2, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    addFillComponents(jpanel1, new int[] { 1, 2, 3, 4, 5 }, new int[] { 1, 2, 3 });
    return jpanel1;
}

97. MainFrame#createButtonsPanel()

Project: checkstyle
File: MainFrame.java
/**
     * Create buttons panel.
     * @return buttons panel.
     */
private JPanel createButtonsPanel() {
    final JButton openFileButton = new JButton(new FileSelectionAction());
    openFileButton.setMnemonic(KeyEvent.VK_S);
    openFileButton.setText("Open File");
    reloadAction.setEnabled(false);
    final JButton reloadFileButton = new JButton(reloadAction);
    reloadFileButton.setMnemonic(KeyEvent.VK_R);
    reloadFileButton.setText("Reload File");
    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(1, 2));
    buttonPanel.add(openFileButton);
    buttonPanel.add(reloadFileButton);
    return buttonPanel;
}

98. EmotesDialog#wrapPanel()

Project: chatty
File: EmotesDialog.java
/**
     * Wrap the given component into a JPanel, which aligns it at the top. There
     * may be an easier/more direct way of doing this. Also add it to a scroll
     * pane.
     * 
     * @param panel
     * @return 
     */
private static JComponent wrapPanel(JComponent panel) {
    panel.setBackground(Color.WHITE);
    JPanel outer = new JPanel();
    outer.setLayout(new GridBagLayout());
    outer.setBackground(Color.WHITE);
    GridBagConstraints gbcTest = new GridBagConstraints();
    gbcTest.fill = GridBagConstraints.HORIZONTAL;
    gbcTest.weightx = 1;
    gbcTest.weighty = 1;
    gbcTest.anchor = GridBagConstraints.NORTH;
    outer.add(panel, gbcTest);
    //outer.setSize(0, 0);
    // Add and configure scroll pane
    JScrollPane scroll = new JScrollPane(outer);
    scroll.getVerticalScrollBar().setUnitIncrement(20);
    return scroll;
}

99. CColorSettingsPanel#buildRow()

Project: binnavi
File: CColorSettingsPanel.java
/**
   * Builds a single row of components in the panel.
   * 
   * @param <T> Type of the editing component.
   * 
   * @param panel Panel the editing component is added to.
   * @param labelText Text of the label that describes the option.
   * @param hint Hint shown as a tooltip.
   * @param component The component to add to the panel.
   * @param isLast True, if the component is the last component to be added to the panel.
   * 
   * @return The panel passed to the function.
   */
private static <T extends Component> T buildRow(final JPanel panel, final String labelText, final String hint, final T component, final boolean isLast) {
    component.setPreferredSize(new Dimension(COLORPANEL_WIDTH, COLORPANEL_HEIGHT));
    final JPanel rowPanel = new JPanel(new BorderLayout());
    rowPanel.setBorder(new EmptyBorder(0, 2, isLast ? 2 : 0, 2));
    rowPanel.add(new JLabel(labelText), BorderLayout.CENTER);
    rowPanel.add(CHintCreator.createHintPanel(component, hint), BorderLayout.EAST);
    panel.add(rowPanel);
    return component;
}

100. CProjectMainPanel#createProjectTreePanel()

Project: binnavi
File: CProjectMainPanel.java
/**
   * Creates the project tree that is shown on the left side of the main window.
   * 
   * @return The project tree panel that contains the project tree.
   */
private JPanel createProjectTreePanel() {
    final JPanel projectTreePanel = new JPanel(new BorderLayout());
    projectTreePanel.setBorder(null);
    projectTreePanel.setBackground(Color.WHITE);
    m_projectTree.setBorder(new EmptyBorder(2, 4, 2, 2));
    m_projectTree.addTreeSelectionListener(new InternalTreeSelectionListener());
    final JScrollPane pane = new JScrollPane(m_projectTree);
    pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    pane.setBorder(null);
    projectTreePanel.add(pane, BorderLayout.CENTER);
    return projectTreePanel;
}