Last change
on this file since 12 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
|
Line | |
---|
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 |
|
---|
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());
|
---|
18 | JLabel label = new JLabel(text);
|
---|
19 | label.setPreferredSize(new Dimension(120, 10));
|
---|
20 | add(label, BorderLayout.WEST);
|
---|
21 | add(comp, BorderLayout.CENTER);
|
---|
22 | }
|
---|
23 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.