Commit 0358d1c7 authored by Mattias Ulbrich's avatar Mattias Ulbrich
Browse files

fixing smaller issues with the settings GUI

parent a3cd916f
......@@ -24,6 +24,8 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.*;
import java.util.List;
import java.util.Arrays;
/**
* Extension of {@link SimpleSettingsPanel} which uses {@link MigLayout} to
......@@ -194,7 +196,7 @@ public abstract class SettingsPanel extends SimpleSettingsPanel {
}
});
if (info != null && !info.isEmpty()) {
pCenter.add(new JLabel());
pCenter.add(new JLabel(info));
pCenter.add(comboBox);
JLabel infoButton = createHelpLabel(info);
pCenter.add(infoButton, new CC().wrap());
......@@ -253,6 +255,22 @@ public abstract class SettingsPanel extends SimpleSettingsPanel {
return field;
}
protected void addRadioButtons(String heading, Object[] alternatives, String description) {
addRadioButtons(heading, Arrays.asList(alternatives), description);
}
protected void addRadioButtons(String title, List<?> alternatives, String description) {
JPanel items = new JPanel(new GridLayout(alternatives.size(), 1));
ButtonGroup bg = new ButtonGroup();
for (Object alt : alternatives) {
JRadioButton radioButton = new JRadioButton(alt.toString());
radioButton.putClientProperty("object", alt);
bg.add(radioButton);
items.add(radioButton);
}
addTitledComponent(title, items, description);
}
/**
* Add a separator line with the given title.
*
......
......@@ -63,7 +63,7 @@ public class SimpleSettingsPanel extends JPanel {
add(pNorth, BorderLayout.NORTH);
add(pCenter, BorderLayout.CENTER);
add(new JScrollPane(pCenter), BorderLayout.CENTER);
}
public void setHeaderText(String text) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment