Last change
on this file since 3 was 1, checked in by Wouter Pasman, 7 years ago |
Initial import : Genius 9.0.0
|
File size:
809 bytes
|
Rev | Line | |
---|
[1] | 1 | package genius.gui.panels;
|
---|
| 2 |
|
---|
| 3 | import java.awt.BorderLayout;
|
---|
| 4 | import java.awt.Component;
|
---|
| 5 | import java.awt.Dimension;
|
---|
| 6 |
|
---|
| 7 | import javax.swing.JLabel;
|
---|
| 8 | import javax.swing.JPanel;
|
---|
| 9 | import javax.swing.JSpinner;
|
---|
| 10 | import javax.swing.SpinnerModel;
|
---|
| 11 |
|
---|
| 12 | /**
|
---|
| 13 | * Spinner but with text label.
|
---|
| 14 | *
|
---|
| 15 | */
|
---|
| 16 | @SuppressWarnings("serial")
|
---|
| 17 | public class SpinnerPanel extends JPanel {
|
---|
| 18 |
|
---|
| 19 | public SpinnerPanel(String label, SpinnerModel model) {
|
---|
| 20 | setLayout(new BorderLayout());
|
---|
| 21 | add(new JLabel(label), BorderLayout.WEST);
|
---|
| 22 | JSpinner spinner = new JSpinner(model);
|
---|
| 23 | spinner.setMaximumSize(new Dimension(300, 30));
|
---|
| 24 | add(spinner, BorderLayout.CENTER);
|
---|
| 25 | // aligns the RIGHT side of the panel with the center of the parent.
|
---|
| 26 | // This limits the total width
|
---|
| 27 | setAlignmentX(Component.RIGHT_ALIGNMENT);
|
---|
| 28 | setMaximumSize(new Dimension(3000000, 30));
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.