01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package wingset;
14:
15: import org.wings.SBorderLayout;
16: import org.wings.SBoxLayout;
17: import org.wings.SComponent;
18: import org.wings.SConstants;
19: import org.wings.SDimension;
20: import org.wings.SIcon;
21: import org.wings.SLabel;
22: import org.wings.SPanel;
23: import org.wings.SURLIcon;
24:
25: /**
26: * @author <a href="mailto:haaf@mercatis.de">Armin Haaf</a>
27: */
28: public class WingsImage extends SPanel {
29: private static final SIcon WINGS_IMAGE = new SURLIcon(
30: "../icons/wings-logo.png");
31:
32: public WingsImage() {
33: setLayout(new SBoxLayout(SBoxLayout.VERTICAL));
34: add(createExample());
35: setPreferredSize(SDimension.FULLAREA);
36: setVerticalAlignment(SConstants.CENTER_ALIGN);
37: }
38:
39: public SComponent createExample() {
40: SPanel p = new SPanel(new SBorderLayout());
41:
42: SLabel label = new SLabel(WINGS_IMAGE);
43: label.setHorizontalAlignment(SConstants.CENTER);
44: p.add(label, SBorderLayout.CENTER);
45:
46: label = new SLabel("Welcome to");
47: label.setHorizontalAlignment(SConstants.CENTER);
48: p.add(label, SBorderLayout.NORTH);
49:
50: label = new SLabel("Have fun!");
51: label.setHorizontalAlignment(SConstants.CENTER);
52: p.add(label, SBorderLayout.SOUTH);
53:
54: return p;
55: }
56: }
|