KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > wingset > WingsImage


1 /*
2  * $Id: WingsImage.java,v 1.7 2005/05/26 13:18:08 neurolabs Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package wingset;
15
16 import org.wings.*;
17
18 /**
19  * @author <a HREF="mailto:haaf@mercatis.de">Armin Haaf</a>
20  * @version $Revision: 1.7 $
21  */

22 public class WingsImage
23         extends SPanel {
24     private static final SIcon WINGS_IMAGE = new SURLIcon("../icons/wings-logo.png");
25
26     public WingsImage() {
27         add(createExample());
28     }
29
30     public SComponent createExample() {
31         SPanel p = new SPanel();
32         final SBorderLayout layout = new SBorderLayout();
33
34         setHorizontalAlignment(SConstants.CENTER);
35         p.setLayout(layout);
36
37         SLabel label = new SLabel(WINGS_IMAGE);
38         label.setHorizontalAlignment(SConstants.CENTER);
39         p.add(label, SBorderLayout.CENTER);
40
41         label = new SLabel("Welcome to");
42         label.setHorizontalAlignment(SConstants.CENTER);
43         p.add(label, SBorderLayout.NORTH);
44
45
46         label = new SLabel("Have fun!");
47         label.setHorizontalAlignment(SConstants.CENTER);
48         p.add(label, SBorderLayout.SOUTH);
49
50         return p;
51     }
52 }
53
54
55
Popular Tags