2
* Copyright 2005-2008 Kirill Grouchnikov, based on work by
3
* Sun Microsystems, Inc. All rights reserved.
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
import java.awt.BorderLayout;
26
import org.jdesktop.swingx.JXHeader;
27
import org.pushingpixels.substance.api.DecorationAreaType;
28
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
29
import org.pushingpixels.substance.api.skin.SubstanceBusinessBlackSteelLookAndFeel;
30
import org.pushingpixels.substance.internal.utils.SubstanceImageCreator;
32
public class HeaderFrame extends JFrame {
33
public HeaderFrame() {
34
super("JXHeader example");
36
this.setLayout(new BorderLayout());
37
ClassLoader cl = Thread.currentThread().getContextClassLoader();
38
URL iconUrl = cl.getResource("docrobot/applications-internet.png");
39
Icon icon = new ImageIcon(iconUrl);
40
icon = new ImageIcon(SubstanceImageCreator.getColorSchemeImage(null,
41
icon, SubstanceLookAndFeel.getCurrentSkin(this.getRootPane())
42
.getActiveColorScheme(
43
DecorationAreaType.PRIMARY_TITLE_PANE), 0.0f));
44
String title = "LGPL license";
45
String description = "This library is free software; you can redistribute it and/or"
46
+ " modify it under the terms of the GNU Lesser General Public"
49
final JXHeader header = new JXHeader(title, description, icon);
50
this.add(header, BorderLayout.NORTH);
52
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
53
this.setSize(440, 300);
54
this.setLocationRelativeTo(null);
57
public static void main(String[] args) throws Exception {
58
JFrame.setDefaultLookAndFeelDecorated(true);
59
UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel());
60
// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
61
SwingUtilities.invokeLater(new Runnable() {
63
new HeaderFrame().setVisible(true);