Skip to content

Commit

Permalink
Updated MigLayout
Browse files Browse the repository at this point in the history
- Updated MigLayout from 3.7.4 to 5.0 (changed Maven repository)
- Fixed Choice-TaskDialog Layout

(cherry picked from commit c1c3966)
  • Loading branch information
Bios-Marcel authored and akuhtz committed Nov 22, 2023
1 parent 36c4d8b commit 1c966b4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
10 changes: 5 additions & 5 deletions swingbits/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
</repositories>

<dependencies>
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout</artifactId>
<version>3.7.4</version>
</dependency>
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout-swing</artifactId>
<version>5.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@

import net.miginfocom.swing.MigLayout;

import net.miginfocom.layout.CC;
import net.miginfocom.layout.LC;
import net.miginfocom.swing.MigLayout;

/**
*
* A set of methods to simplify creation of task dialogs
Expand Down Expand Up @@ -421,15 +425,16 @@ public int choice(final int defaultChoice, List<CommandLink> choices) {
final List<CommandLinkButton> buttons = new ArrayList<CommandLinkButton>();

CommandLinkButton btn;
JPanel p = new JPanel(new MigLayout(""));
p.setOpaque(false);
for (CommandLink link : choices) {
btn = new CommandLinkButton(link, TaskDialog.getDesign().getCommandLinkPainter());
models.add(btn.getModel());
buttons.add(btn);
bGroup.add(btn);
p.add(btn, "dock north, gapbottom 8");
}
final JPanel p = new JPanel(new MigLayout(new LC().flowY().noGrid()));
p.setOpaque(false);
for (final CommandLink link : choices)
{
btn = new CommandLinkButton(link, TaskDialog.getDesign().getCommandLinkPainter());
models.add(btn.getModel());
buttons.add(btn);
bGroup.add(btn);
p.add(btn, new CC().gapBottom("8"));
}

if (defaultChoice >= 0 && defaultChoice < choices.size()) {
bGroup.setSelected(models.get(defaultChoice), true);
Expand Down

0 comments on commit 1c966b4

Please sign in to comment.