import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import javax.swing.BorderFactory;
import javax.swing.JCheckBox;
-import javax.swing.JLabel;
import javax.swing.JPanel;
import net.pterodactylus.sonitus.data.controller.Switch;
/**
* Creates a new fader panel.
*
- * @param fader
- * The fader being controlled
+ * @param switchController
+ * The switch being controlled
*/
public SwitchPanel(final Switch switchController) {
super(new GridBagLayout());
- setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));
-
- /* create label. */
- JLabel label = new JLabel(switchController.name());
- add(label, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
/* create checkbox. */
JCheckBox checkBox = new JCheckBox();
switchController.value(((JCheckBox) actionEvent.getSource()).isSelected());
}
});
- add(checkBox, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
+ add(checkBox, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
}
}