diff options
author | ralph isenmann | 2022-02-18 15:27:25 +0100 |
---|---|---|
committer | ralph isenmann | 2022-02-18 15:27:25 +0100 |
commit | 95438dd8847dd9e5a1be70cf450ee3ea527e6164 (patch) | |
tree | a07bf0ea4eeed0457cc3d4879ba68897fe4b1e90 /dozentenmodul | |
parent | [Client] remove useless log message (diff) | |
download | tutor-module-95438dd8847dd9e5a1be70cf450ee3ea527e6164.tar.gz tutor-module-95438dd8847dd9e5a1be70cf450ee3ea527e6164.tar.xz tutor-module-95438dd8847dd9e5a1be70cf450ee3ea527e6164.zip |
[CLIENT] fix layout in image type chooser
Diffstat (limited to 'dozentenmodul')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageTypePageLayout.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageTypePageLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageTypePageLayout.java index 01558a60..7c178940 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageTypePageLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageTypePageLayout.java @@ -7,7 +7,6 @@ import org.openslx.dozmod.gui.helper.I18n; import org.openslx.dozmod.gui.wizard.Wizard; import org.openslx.dozmod.gui.wizard.WizardPage; -import java.awt.GridBagConstraints; import java.awt.event.MouseEvent; import javax.swing.*; @@ -44,10 +43,10 @@ public abstract class ImageTypePageLayout extends WizardPage { txtInfoText.setFocusable(false); txtInfoText.setOpaque(false); txtInfoText.setText(I18n.PAGE_LAYOUT.getString("ImageTypePageLayout.newVmInformation.text")); - + QLabel lblVmImage = new QLabel(Gui.getScaledIconResource("/img/virtualization.png", I18n.WINDOW_LAYOUT.getString("LectureList.Button.editLecture.description"), 48, this)); - + lblVmImage.addMouseListener(new MouseInputAdapter() { @Override public void mouseClicked(MouseEvent e) { @@ -65,25 +64,28 @@ public abstract class ImageTypePageLayout extends WizardPage { rbtnNewVmImage = new JRadioButton(I18n.PAGE_LAYOUT.getString("ImageTypePageLayout.button.newVM")); rbtnNewDockerImage = new JRadioButton(I18n.PAGE_LAYOUT.getString("ImageTypePageLayout.button.newDocker")); + // center the radiobuttion in the gridbag cell + rbtnNewVmImage.setHorizontalAlignment(SwingConstants.CENTER); + rbtnNewDockerImage.setHorizontalAlignment(SwingConstants.CENTER); + btgrpImageTyp = new ButtonGroup(); btgrpImageTyp.add(rbtnNewVmImage); btgrpImageTyp.add(rbtnNewDockerImage); - // ##################################### // Create the Layout GridManager grid = new GridManager(this, 2, false); grid.add(txtInfoText, 2).fill(true, false).expand(true, false); - grid.nextRow(); - grid.nextRow(); + grid.add(Box.createVerticalGlue(), 2).expand(true, true); + grid.add(lblVmImage).fill(true, true).expand(true, true); grid.add(lblDockerImage).fill(true, true).expand(true, true); grid.nextRow(); - // TODO how to center the radiotbns under the icon/lable? - grid.add(rbtnNewVmImage).fill(true, false); - grid.add(rbtnNewDockerImage).fill(true, false).expand(true, false).anchor(GridBagConstraints.CENTER); + + grid.add(rbtnNewVmImage).fill(true, false).expand(true, true); + grid.add(rbtnNewDockerImage).fill(true, false).expand(true, false); + grid.nextRow(); grid.finish(true); - } } |