TestBaselineFrame.java :  » Swing-Library » substance-look-feel » test » Java Open Source

Java Open Source » Swing Library » substance look feel 
substance look feel » test » TestBaselineFrame.java
/*
 * Copyright (c) 2005-2008 Substance Kirill Grouchnikov, based on work by
 * Sun Microsystems, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
package test;

import javax.swing.*;
import javax.swing.border.EmptyBorder;

import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel;

import test.check.SampleMenuFactory;

public class TestBaselineFrame extends JFrame {
  public TestBaselineFrame() {
    super("Baseline");
    TestBaselinePanel testPanel = new TestBaselinePanel();
    testPanel.setBorder(new EmptyBorder(10, 10, 5, 5));
    this.add(testPanel);
    JMenuBar jmb = new JMenuBar();
    jmb.add(SampleMenuFactory.getLookAndFeelMenu(this));
    this.setJMenuBar(jmb);
    this.setSize(250, 250);
    this.setLocationRelativeTo(null);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }

  public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel());
    JFrame.setDefaultLookAndFeelDecorated(true);
    UIManager.put(SubstanceLookAndFeel.NO_EXTRA_ELEMENTS, Boolean.TRUE);
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        new TestBaselineFrame().setVisible(true);
      }
    });
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.