1 | public Component add(Component c) {↵ | | 1 | public Component add(Component c) {↵
|
2 | // This won't work right if we remove components. But we don't, so I'm↵ | | 2 | // This won't work right if we remove components. But we don't, so I'm↵
|
3 | // not going to worry about it right now.↵ | | 3 | // not going to worry about it right now.↵
|
4 | if (hgap > 0 && subPanel.getComponentCount() > 0) {↵ | | 4 | if (vgap > 0 && subPanel.getComponentCount() > 0) {↵
|
5 | subPanel.add(Box.createHorizontalStrut(hgap));↵ | | 5 | subPanel.add(Box.createVerticalStrut(vgap));↵
|
6 | }↵ | | 6 | }↵
|
|
7 | if (c instanceof JComponent) {↵ | | 7 | if (c instanceof JComponent) {↵
|
8 | ((JComponent) c).setAlignmentY(verticalAlign);↵ | | 8 | ((JComponent) c).setAlignmentX(horizontalAlign);↵
|
9 | }↵ | | 9 | }↵
|
|
10 | return subPanel.add(c);↵ | | 10 | return subPanel.add(c);↵
|
11 | | | 11 |
|