Example usage for javax.swing GroupLayout replace

List of usage examples for javax.swing GroupLayout replace

Introduction

In this page you can find the example usage for javax.swing GroupLayout replace.

Prototype

public void replace(Component existingComponent, Component newComponent) 

Source Link

Document

Replaces an existing component with a new one.

Usage

From source file:com.github.alexfalappa.nbspringboot.projects.initializr.InitializrProjectPanelVisual2.java

/**
 * Fixes the boot version of the dependencies.
 * <p>//from  ww w .j  av a  2s . c  om
 * Does nothing if the panel has not been initialized.
 *
 * @param bootVersion
 */
public void fixBootVersion(String bootVersion) {
    Objects.requireNonNull(bootVersion);
    if (initialized) {
        // substitute combo with label
        javax.swing.GroupLayout layout = (javax.swing.GroupLayout) this.getLayout();
        final JLabel label = new JLabel(bootVersion);
        label.setFont(label.getFont().deriveFont(Font.BOLD));
        layout.replace(cbBootVersion, label);
        // adapt dependencies panel
        pBootDependencies.adaptToBootVersion(bootVersion);
    }
}