01: /*
02: * TabTest.java
03: *
04: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package org.executequery.plaf;
23:
24: import java.awt.BorderLayout;
25: import java.awt.Color;
26: import javax.swing.BorderFactory;
27: import javax.swing.JFrame;
28: import javax.swing.JLabel;
29: import javax.swing.JPanel;
30: import javax.swing.JTabbedPane;
31: import javax.swing.UIManager;
32: import org.underworldlabs.swing.CloseTabbedPane;
33:
34: /* ----------------------------------------------------------
35: * CVS NOTE: Changes to the CVS repository prior to the
36: * release of version 3.0.0beta1 has meant a
37: * resetting of CVS revision numbers.
38: * ----------------------------------------------------------
39: */
40:
41: /**
42: *
43: * @author Takis Diakoumis
44: * @version $Revision: 1.4 $
45: * @date $Date: 2006/05/14 06:56:52 $
46: */
47: public class TabTest extends JFrame {
48:
49: /** Creates a new instance of TabTest */
50: public TabTest() {
51: super ("Tab Test");
52:
53: try {
54: javax.swing.plaf.metal.MetalLookAndFeel metal = new javax.swing.plaf.metal.MetalLookAndFeel();
55: metal
56: .setCurrentTheme(new javax.swing.plaf.metal.DefaultMetalTheme());
57: UIManager.setLookAndFeel(metal);
58: } catch (Exception e) {
59: }
60:
61: addComponents();
62: setDefaultCloseOperation(EXIT_ON_CLOSE);
63: setSize(450, 250);
64: setVisible(true);
65: }
66:
67: private void addComponents() {
68: // CloseTabContainer container = new CloseTabContainer(JTabbedPane.TOP);
69: CloseTabbedPane tabPane = new CloseTabbedPane(
70: JTabbedPane.BOTTOM, JTabbedPane.SCROLL_TAB_LAYOUT);
71:
72: for (int i = 0; i < 6; i++) {
73: JPanel panel = new JPanel();
74: panel.setBackground(Color.WHITE);
75: panel.add(new JLabel("Panel " + i));
76: tabPane.add("Panel " + i, panel);
77: }
78:
79: JPanel base = new JPanel(new BorderLayout());
80: base.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
81: base.add(tabPane, BorderLayout.CENTER);
82: getContentPane().add(base, BorderLayout.CENTER);
83:
84: }
85:
86: public static void main(String args[]) {
87: new TabTest();
88: }
89: }
|