Last change
on this file since 14 was 8, checked in by Wouter Pasman, 7 years ago |
#3 fix labels to fixed width of 120 px to get nicer layout. Removed right alignment of some comboboxes.
|
File size:
571 bytes
|
Rev | Line | |
---|
[1] | 1 | package genius.gui.panels;
|
---|
| 2 |
|
---|
| 3 | import java.awt.BorderLayout;
|
---|
| 4 | import java.awt.Component;
|
---|
[8] | 5 | import java.awt.Dimension;
|
---|
[1] | 6 |
|
---|
| 7 | import javax.swing.JLabel;
|
---|
| 8 | import javax.swing.JPanel;
|
---|
| 9 |
|
---|
| 10 | /**
|
---|
| 11 | * Panel with a text on the left and an arbitrary component on the right
|
---|
| 12 | *
|
---|
| 13 | */
|
---|
| 14 | @SuppressWarnings("serial")
|
---|
| 15 | public class LabelAndComponent extends JPanel {
|
---|
| 16 | public LabelAndComponent(String text, Component comp) {
|
---|
| 17 | super(new BorderLayout());
|
---|
[8] | 18 | JLabel label = new JLabel(text);
|
---|
| 19 | label.setPreferredSize(new Dimension(120, 10));
|
---|
| 20 | add(label, BorderLayout.WEST);
|
---|
[1] | 21 | add(comp, BorderLayout.CENTER);
|
---|
| 22 | }
|
---|
| 23 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.