<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FSwing_Components%2FJGoodies_Looks</id>
		<title>Java/Swing Components/JGoodies Looks - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FSwing_Components%2FJGoodies_Looks"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Swing_Components/JGoodies_Looks&amp;action=history"/>
		<updated>2026-04-23T02:42:53Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/Swing_Components/JGoodies_Looks&amp;diff=8207&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Swing_Components/JGoodies_Looks&amp;diff=8207&amp;oldid=prev"/>
				<updated>2010-06-01T06:56:28Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 06:56, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/Swing_Components/JGoodies_Looks&amp;diff=8206&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Swing_Components/JGoodies_Looks&amp;diff=8206&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:46Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Builds the main frame in the Simple Looks Demo ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2001-2005 JGoodies Karsten Lentzsch. All Rights Reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without &lt;br /&gt;
 * modification, are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *  o Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *    this list of conditions and the following disclaimer. &lt;br /&gt;
 *     &lt;br /&gt;
 *  o Redistributions in binary form must reproduce the above copyright notice, &lt;br /&gt;
 *    this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *    and/or other materials provided with the distribution. &lt;br /&gt;
 *     &lt;br /&gt;
 *  o Neither the name of JGoodies Karsten Lentzsch nor the names of &lt;br /&gt;
 *    its contributors may be used to endorse or promote products derived &lt;br /&gt;
 *    from this software without specific prior written permission. &lt;br /&gt;
 *     &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &amp;quot;AS IS&amp;quot; &lt;br /&gt;
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, &lt;br /&gt;
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR &lt;br /&gt;
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR &lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, &lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, &lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; &lt;br /&gt;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, &lt;br /&gt;
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE &lt;br /&gt;
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, &lt;br /&gt;
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. &lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
import java.awt.*;&lt;br /&gt;
import java.awt.event.ActionEvent;&lt;br /&gt;
import java.awt.event.ActionListener;&lt;br /&gt;
import java.net.URL;&lt;br /&gt;
import javax.swing.*;&lt;br /&gt;
import javax.swing.border.Border;&lt;br /&gt;
import javax.swing.border.EmptyBorder;&lt;br /&gt;
import javax.swing.plaf.UIResource;&lt;br /&gt;
import javax.swing.plaf.metal.DefaultMetalTheme;&lt;br /&gt;
import javax.swing.plaf.metal.MetalLookAndFeel;&lt;br /&gt;
import com.jgoodies.looks.LookUtils;&lt;br /&gt;
import com.jgoodies.looks.Options;&lt;br /&gt;
import com.jgoodies.looks.plastic.PlasticLookAndFeel;&lt;br /&gt;
import com.jgoodies.looks.windows.WindowsLookAndFeel;&lt;br /&gt;
/** &lt;br /&gt;
 * Builds the main frame in the Simple Looks Demo. &lt;br /&gt;
 * Demonstrates and tests different multi-platform issues by&lt;br /&gt;
 * showing a variety of Swing widgets in different configurations.&lt;br /&gt;
 * Also, this frame contains examples for Swing misuse,&lt;br /&gt;
 * that can be automatically corrected by ClearLook.&amp;lt;p&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * This class provides a couple of protected methods that create&lt;br /&gt;
 * components or a builder. The full JGoodies Looks Demo overrides &lt;br /&gt;
 * these methods to vend components or builders from the &lt;br /&gt;
 * JGoodies UI framework that better handle different platforms.&lt;br /&gt;
 * &lt;br /&gt;
 * @author Karsten Lentzsch&lt;br /&gt;
 * @version $Revision: 1.17 $&lt;br /&gt;
 */&lt;br /&gt;
public class DemoFrame extends JFrame {&lt;br /&gt;
    protected static final Dimension PREFERRED_SIZE =&lt;br /&gt;
        LookUtils.IS_LOW_RESOLUTION &lt;br /&gt;
            ? new Dimension(650, 510) &lt;br /&gt;
            : new Dimension(730, 560);&lt;br /&gt;
            &lt;br /&gt;
    private static final String COPYRIGHT = &lt;br /&gt;
        &amp;quot;\u00a9 2001-2005 JGoodies Karsten Lentzsch. All Rights Reserved.&amp;quot;;    &lt;br /&gt;
        &lt;br /&gt;
    &lt;br /&gt;
    /** Describes optional settings of the JGoodies Looks. */&lt;br /&gt;
    private final Settings settings;&lt;br /&gt;
    /**&lt;br /&gt;
     * Constructs a &amp;lt;code&amp;gt;DemoFrame&amp;lt;/code&amp;gt;, configures the UI, &lt;br /&gt;
     * and builds the content.&lt;br /&gt;
     */&lt;br /&gt;
    protected DemoFrame(Settings settings) {&lt;br /&gt;
        this.settings = settings;&lt;br /&gt;
        configureUI();&lt;br /&gt;
        build();&lt;br /&gt;
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        DemoFrame instance = new DemoFrame(createSettings());&lt;br /&gt;
        instance.setSize(PREFERRED_SIZE);&lt;br /&gt;
        instance.locateOnScreen(instance);&lt;br /&gt;
        instance.setVisible(true);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    private static Settings createSettings() {&lt;br /&gt;
        Settings settings = Settings.createDefault();&lt;br /&gt;
        &lt;br /&gt;
        // Configure the settings here.&lt;br /&gt;
        &lt;br /&gt;
        return settings;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Configures the user interface; requests Swing settings and &lt;br /&gt;
     * jGoodies Looks options from the launcher.&lt;br /&gt;
     */&lt;br /&gt;
    private void configureUI() {&lt;br /&gt;
        Options.setDefaultIconSize(new Dimension(18, 18));&lt;br /&gt;
        // Set font options    &lt;br /&gt;
        UIManager.put(&lt;br /&gt;
            Options.USE_SYSTEM_FONTS_APP_KEY,&lt;br /&gt;
            settings.isUseSystemFonts());&lt;br /&gt;
        Options.setGlobalFontSizeHints(settings.getFontSizeHints());&lt;br /&gt;
        Options.setUseNarrowButtons(settings.isUseNarrowButtons());&lt;br /&gt;
        &lt;br /&gt;
        // Global options&lt;br /&gt;
        Options.setTabIconsEnabled(settings.isTabIconsEnabled());&lt;br /&gt;
        UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, &lt;br /&gt;
                settings.isPopupDropShadowEnabled());&lt;br /&gt;
        // Swing Settings&lt;br /&gt;
        LookAndFeel selectedLaf = settings.getSelectedLookAndFeel();&lt;br /&gt;
        if (selectedLaf instanceof PlasticLookAndFeel) {&lt;br /&gt;
            PlasticLookAndFeel.setMyCurrentTheme(settings.getSelectedTheme());&lt;br /&gt;
            PlasticLookAndFeel.setTabStyle(settings.getPlasticTabStyle());&lt;br /&gt;
            PlasticLookAndFeel.setHighContrastFocusColorsEnabled(&lt;br /&gt;
                settings.isPlasticHighContrastFocusEnabled());&lt;br /&gt;
        } else if (selectedLaf.getClass() == MetalLookAndFeel.class) {&lt;br /&gt;
            MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Work around caching in MetalRadioButtonUI&lt;br /&gt;
        JRadioButton radio = new JRadioButton();&lt;br /&gt;
        radio.getUI().uninstallUI(radio);&lt;br /&gt;
        JCheckBox checkBox = new JCheckBox();&lt;br /&gt;
        checkBox.getUI().uninstallUI(checkBox);&lt;br /&gt;
        try {&lt;br /&gt;
            UIManager.setLookAndFeel(selectedLaf);&lt;br /&gt;
        } catch (Exception e) {&lt;br /&gt;
            System.out.println(&amp;quot;Can&amp;quot;t change L&amp;amp;F: &amp;quot; + e);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds the &amp;lt;code&amp;gt;DemoFrame&amp;lt;/code&amp;gt; using Options from the Launcher.&lt;br /&gt;
     */&lt;br /&gt;
    private void build() {&lt;br /&gt;
        setContentPane(buildContentPane());&lt;br /&gt;
        setTitle(getWindowTitle());&lt;br /&gt;
        setJMenuBar(&lt;br /&gt;
            createMenuBuilder().buildMenuBar(&lt;br /&gt;
                settings,&lt;br /&gt;
                createHelpActionListener(),&lt;br /&gt;
                createAboutActionListener()));&lt;br /&gt;
        setIconImage(readImageIcon(&amp;quot;eye_16x16.gif&amp;quot;).getImage());&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    /** &lt;br /&gt;
     * Creates and returns a builder that builds the menu.&lt;br /&gt;
     * This method is overriden by the full JGoodies Looks Demo to use&lt;br /&gt;
     * a more sophisticated menu builder that uses the JGoodies&lt;br /&gt;
     * UI Framework.&lt;br /&gt;
     * &lt;br /&gt;
     * @return the builder that builds the menu bar&lt;br /&gt;
     */&lt;br /&gt;
    protected MenuBuilder createMenuBuilder() {&lt;br /&gt;
        return new MenuBuilder();&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds and answers the content.&lt;br /&gt;
     */&lt;br /&gt;
    private JComponent buildContentPane() {&lt;br /&gt;
        JPanel panel = new JPanel(new BorderLayout());&lt;br /&gt;
        panel.add(buildToolBar(), BorderLayout.NORTH);&lt;br /&gt;
        panel.add(buildMainPanel(), BorderLayout.CENTER);&lt;br /&gt;
        return panel;&lt;br /&gt;
    }&lt;br /&gt;
    // Tool Bar *************************************************************&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds, configures and returns the toolbar. Requests&lt;br /&gt;
     * HeaderStyle, look-specific BorderStyles, and Plastic 3D Hint &lt;br /&gt;
     * from Launcher.&lt;br /&gt;
     */&lt;br /&gt;
    private Component buildToolBar() {&lt;br /&gt;
        JToolBar toolBar = new JToolBar();&lt;br /&gt;
        toolBar.setFloatable(false);&lt;br /&gt;
        toolBar.putClientProperty(&amp;quot;JToolBar.isRollover&amp;quot;, Boolean.TRUE);&lt;br /&gt;
        // Swing&lt;br /&gt;
        toolBar.putClientProperty(&lt;br /&gt;
            Options.HEADER_STYLE_KEY,&lt;br /&gt;
            settings.getToolBarHeaderStyle());&lt;br /&gt;
        toolBar.putClientProperty(&lt;br /&gt;
            PlasticLookAndFeel.BORDER_STYLE_KEY,&lt;br /&gt;
            settings.getToolBarPlasticBorderStyle());&lt;br /&gt;
        toolBar.putClientProperty(&lt;br /&gt;
            WindowsLookAndFeel.BORDER_STYLE_KEY,&lt;br /&gt;
            settings.getToolBarWindowsBorderStyle());&lt;br /&gt;
        toolBar.putClientProperty(&lt;br /&gt;
            PlasticLookAndFeel.IS_3D_KEY,&lt;br /&gt;
            settings.getToolBar3DHint());&lt;br /&gt;
        AbstractButton button;&lt;br /&gt;
        toolBar.add(createToolBarButton(&amp;quot;backward.gif&amp;quot;));&lt;br /&gt;
        button = createToolBarButton(&amp;quot;forward.gif&amp;quot;);&lt;br /&gt;
        button.setEnabled(false);&lt;br /&gt;
        toolBar.add(button);&lt;br /&gt;
        toolBar.add(createToolBarButton(&amp;quot;home.gif&amp;quot;));&lt;br /&gt;
        toolBar.addSeparator();&lt;br /&gt;
        toolBar.add(createOpenButton());&lt;br /&gt;
        toolBar.add(createToolBarButton(&amp;quot;print.gif&amp;quot;));&lt;br /&gt;
        toolBar.add(createToolBarButton(&amp;quot;refresh.gif&amp;quot;));&lt;br /&gt;
        toolBar.addSeparator();&lt;br /&gt;
        ButtonGroup group = new ButtonGroup();&lt;br /&gt;
        button = createToolBarRadioButton(&amp;quot;pie_mode.png&amp;quot;);&lt;br /&gt;
        button.setSelectedIcon(readImageIcon(&amp;quot;pie_mode_selected.gif&amp;quot;));&lt;br /&gt;
        group.add(button);&lt;br /&gt;
        button.setSelected(true);&lt;br /&gt;
        toolBar.add(button);&lt;br /&gt;
        button = createToolBarRadioButton(&amp;quot;bar_mode.png&amp;quot;);&lt;br /&gt;
        button.setSelectedIcon(readImageIcon(&amp;quot;bar_mode_selected.gif&amp;quot;));&lt;br /&gt;
        group.add(button);&lt;br /&gt;
        toolBar.add(button);&lt;br /&gt;
        button = createToolBarRadioButton(&amp;quot;table_mode.png&amp;quot;);&lt;br /&gt;
        button.setSelectedIcon(readImageIcon(&amp;quot;table_mode_selected.gif&amp;quot;));&lt;br /&gt;
        group.add(button);&lt;br /&gt;
        toolBar.add(button);&lt;br /&gt;
        toolBar.addSeparator();&lt;br /&gt;
        button = createToolBarButton(&amp;quot;help.gif&amp;quot;);&lt;br /&gt;
        button.addActionListener(createHelpActionListener());&lt;br /&gt;
        toolBar.add(button);&lt;br /&gt;
        toolBar.add(Box.createGlue());&lt;br /&gt;
        button = new RolloverCheckButton();&lt;br /&gt;
        button.setToolTipText(&amp;quot;Shall show border when mouse is over&amp;quot;);&lt;br /&gt;
        button.setMargin(new Insets(0, 0, 0, 0));&lt;br /&gt;
        toolBar.add(button);&lt;br /&gt;
        return toolBar;&lt;br /&gt;
    }&lt;br /&gt;
    private AbstractButton createOpenButton() {&lt;br /&gt;
        AbstractButton button = createToolBarButton(&amp;quot;open.gif&amp;quot;);&lt;br /&gt;
        button.addActionListener(new ActionListener() {&lt;br /&gt;
            public void actionPerformed(ActionEvent e) {&lt;br /&gt;
                new JFileChooser().showOpenDialog(DemoFrame.this);&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
        return button;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Creates and returns a &amp;lt;code&amp;gt;JButton&amp;lt;/code&amp;gt; &lt;br /&gt;
     * configured for use in a JToolBar.&amp;lt;p&amp;gt;&lt;br /&gt;
     * &lt;br /&gt;
     * This is a simplified method that is overriden by the Looks Demo.&lt;br /&gt;
     * The full code uses the JGoodies UI framework&amp;quot;s ToolBarButton&lt;br /&gt;
     * that better handles platform differences.&lt;br /&gt;
     */&lt;br /&gt;
    protected AbstractButton createToolBarButton(String iconName) {&lt;br /&gt;
        JButton button = new JButton(readImageIcon(iconName));&lt;br /&gt;
        button.setFocusable(false);&lt;br /&gt;
        return button;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Creates and returns a &amp;lt;code&amp;gt;JToggleButton&amp;lt;/code&amp;gt; &lt;br /&gt;
     * configured for use in a JToolBar.&amp;lt;p&amp;gt;&lt;br /&gt;
     * &lt;br /&gt;
     * This is a simplified method that is overriden by the Looks Demo.&lt;br /&gt;
     * The full code uses the JGoodies UI framework&amp;quot;s ToolBarButton&lt;br /&gt;
     * that better handles platform differences.&lt;br /&gt;
     */&lt;br /&gt;
    protected AbstractButton createToolBarRadioButton(String iconName) {&lt;br /&gt;
        JToggleButton button = new JToggleButton(readImageIcon(iconName));&lt;br /&gt;
        button.setFocusable(false);&lt;br /&gt;
        return button;&lt;br /&gt;
    }&lt;br /&gt;
    // Tabbed Pane **********************************************************&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds and answers the tabbed pane.&lt;br /&gt;
     */&lt;br /&gt;
    private Component buildMainPanel() {&lt;br /&gt;
        JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP);&lt;br /&gt;
        //tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);&lt;br /&gt;
        addTabs(tabbedPane);&lt;br /&gt;
        tabbedPane.setBorder(new EmptyBorder(10, 10, 10, 10));&lt;br /&gt;
        return tabbedPane;&lt;br /&gt;
    }&lt;br /&gt;
    private void addTabs(JTabbedPane tabbedPane) {&lt;br /&gt;
        tabbedPane.addTab(&amp;quot;State&amp;quot;,     new StatesTab().build());&lt;br /&gt;
        tabbedPane.addTab(&amp;quot;Align&amp;quot;,     new AlignmentTab().build());&lt;br /&gt;
        tabbedPane.addTab(&amp;quot;Tab&amp;quot;,       new TabTestTab().build());&lt;br /&gt;
        tabbedPane.addTab(&amp;quot;Split&amp;quot;,     new SplitTab().build());&lt;br /&gt;
        tabbedPane.addTab(&amp;quot;HTML&amp;quot;,      new HtmlTab().build());&lt;br /&gt;
        tabbedPane.addTab(&amp;quot;Dialog&amp;quot;,    new DialogsTab().build(tabbedPane));&lt;br /&gt;
        tabbedPane.addTab(&amp;quot;Desktop&amp;quot;,   new DesktopTab().build());&lt;br /&gt;
        tabbedPane.addTab(&amp;quot;Narrow&amp;quot;,    new NarrowTab().build());&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    protected String getWindowTitle() {&lt;br /&gt;
        return &amp;quot;Simple Looks Demo&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Helper Code **********************************************************************&lt;br /&gt;
    /*&lt;br /&gt;
     * Looks up and answers an icon for the specified filename suffix.&amp;lt;p&amp;gt;&lt;br /&gt;
     */&lt;br /&gt;
    protected static ImageIcon readImageIcon(String filename) {&lt;br /&gt;
        URL url =&lt;br /&gt;
            DemoFrame.class.getClassLoader().getResource(&amp;quot;images/&amp;quot; + filename);&lt;br /&gt;
        return new ImageIcon(url);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Locates the given component on the screen&amp;quot;s center.&lt;br /&gt;
     */&lt;br /&gt;
    protected void locateOnScreen(Component component) {&lt;br /&gt;
        Dimension paneSize = component.getSize();&lt;br /&gt;
        Dimension screenSize = component.getToolkit().getScreenSize();&lt;br /&gt;
        component.setLocation(&lt;br /&gt;
            (screenSize.width  - paneSize.width)  / 2,&lt;br /&gt;
            (screenSize.height - paneSize.height) / 2);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Creates and answers an ActionListener that opens the help viewer.&lt;br /&gt;
     */&lt;br /&gt;
    protected ActionListener createHelpActionListener() {&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Creates and answers an ActionListener that opens the about dialog.&lt;br /&gt;
     */&lt;br /&gt;
    protected ActionListener createAboutActionListener() {&lt;br /&gt;
        return new ActionListener() {&lt;br /&gt;
            public void actionPerformed(ActionEvent e) {&lt;br /&gt;
                JOptionPane.showMessageDialog(&lt;br /&gt;
                    DemoFrame.this,&lt;br /&gt;
                    &amp;quot;The simple Looks Demo Application\n\n&amp;quot;&lt;br /&gt;
                        + COPYRIGHT + &amp;quot;\n\n&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
    }&lt;br /&gt;
    // Checks that all tool bar buttons have a UIResource border&lt;br /&gt;
    private static class RolloverCheckButton extends JButton {&lt;br /&gt;
        private boolean checked = false;&lt;br /&gt;
        public void paint(Graphics g) {&lt;br /&gt;
            if (!checked) {&lt;br /&gt;
                checkAndSetResult();&lt;br /&gt;
            }&lt;br /&gt;
            super.paint(g);&lt;br /&gt;
        }&lt;br /&gt;
        private void checkAndSetResult() {&lt;br /&gt;
            Icon passedIcon = readImageIcon(&amp;quot;passed.gif&amp;quot;);&lt;br /&gt;
            Icon failedIcon = readImageIcon(&amp;quot;failed.gif&amp;quot;);&lt;br /&gt;
            boolean passed = allButtonBordersAreUIResources();&lt;br /&gt;
            setIcon(passed ? passedIcon : failedIcon);&lt;br /&gt;
            setText(passed ? &amp;quot;Can Swap L&amp;amp;F&amp;quot; : &amp;quot;Can&amp;quot;t Swap L&amp;amp;F&amp;quot;);&lt;br /&gt;
            checked = true;&lt;br /&gt;
        }&lt;br /&gt;
        /**&lt;br /&gt;
         * Checks and answers whether all button borders implement UIResource.&lt;br /&gt;
         */&lt;br /&gt;
        private boolean allButtonBordersAreUIResources() {&lt;br /&gt;
            JToolBar bar = (JToolBar) getParent();&lt;br /&gt;
            for (int i = bar.getComponentCount() - 1; i &amp;gt;= 0; i--) {&lt;br /&gt;
                Component child = bar.getComponent(i);&lt;br /&gt;
                if (child instanceof JButton) {&lt;br /&gt;
                    Border b = ((JButton) child).getBorder();&lt;br /&gt;
                    if (!(b instanceof UIResource))&lt;br /&gt;
                        return false;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The main class of the JGoodies Tiny application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2001-2005 JGoodies Karsten Lentzsch. All Rights Reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without &lt;br /&gt;
 * modification, are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *  o Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *    this list of conditions and the following disclaimer. &lt;br /&gt;
 *     &lt;br /&gt;
 *  o Redistributions in binary form must reproduce the above copyright notice, &lt;br /&gt;
 *    this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *    and/or other materials provided with the distribution. &lt;br /&gt;
 *     &lt;br /&gt;
 *  o Neither the name of JGoodies Karsten Lentzsch nor the names of &lt;br /&gt;
 *    its contributors may be used to endorse or promote products derived &lt;br /&gt;
 *    from this software without specific prior written permission. &lt;br /&gt;
 *     &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &amp;quot;AS IS&amp;quot; &lt;br /&gt;
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, &lt;br /&gt;
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR &lt;br /&gt;
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR &lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, &lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, &lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; &lt;br /&gt;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, &lt;br /&gt;
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE &lt;br /&gt;
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, &lt;br /&gt;
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. &lt;br /&gt;
 */&lt;br /&gt;
import java.awt.BorderLayout;&lt;br /&gt;
import java.awt.ruponent;&lt;br /&gt;
import java.awt.Dimension;&lt;br /&gt;
import java.awt.Frame;&lt;br /&gt;
import javax.swing.*;&lt;br /&gt;
import javax.swing.border.EmptyBorder;&lt;br /&gt;
import com.jgoodies.looks.FontSizeHints;&lt;br /&gt;
import com.jgoodies.looks.LookUtils;&lt;br /&gt;
import com.jgoodies.looks.Options;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * The main class of the JGoodies Tiny application. &lt;br /&gt;
 * It configures the UI, builds the main frame and opens it.&lt;br /&gt;
 * &amp;lt;p&amp;gt;&lt;br /&gt;
 * The JGoodies Looks Professional comes with Skeleton, a much better sample&lt;br /&gt;
 * application that separates concerns and uses a scalable architecture.&lt;br /&gt;
 *&lt;br /&gt;
 * @author Karsten Lentzsch&lt;br /&gt;
 */&lt;br /&gt;
public class Tiny {&lt;br /&gt;
    /**&lt;br /&gt;
     * Configures the UI, then builds and opens the UI.&lt;br /&gt;
     */&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        Tiny instance = new Tiny();&lt;br /&gt;
        instance.configureUI();&lt;br /&gt;
        instance.buildInterface();&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Configures the UI; tries to set the system look on Mac, &lt;br /&gt;
     * &amp;lt;code&amp;gt;WindowsLookAndFeel&amp;lt;/code&amp;gt; on general Windows, and&lt;br /&gt;
     * &amp;lt;code&amp;gt;Plastic3DLookAndFeel&amp;lt;/code&amp;gt; on Windows XP and all other OS.&amp;lt;p&amp;gt;&lt;br /&gt;
     * &lt;br /&gt;
     * The JGoodies Swing Suite&amp;quot;s &amp;lt;code&amp;gt;ApplicationStarter&amp;lt;/code&amp;gt;,&lt;br /&gt;
     * &amp;lt;code&amp;gt;ExtUIManager&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;LookChoiceStrategies&amp;lt;/code&amp;gt;&lt;br /&gt;
     * classes provide a much more fine grained algorithm to choose and&lt;br /&gt;
     * restore a look and theme.&lt;br /&gt;
     */&lt;br /&gt;
    private void configureUI() {&lt;br /&gt;
        UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);&lt;br /&gt;
        Options.setGlobalFontSizeHints(FontSizeHints.MIXED);&lt;br /&gt;
        Options.setDefaultIconSize(new Dimension(18, 18));&lt;br /&gt;
        String lafName =&lt;br /&gt;
            LookUtils.IS_OS_WINDOWS_XP&lt;br /&gt;
                ? Options.getCrossPlatformLookAndFeelClassName()&lt;br /&gt;
                : Options.getSystemLookAndFeelClassName();&lt;br /&gt;
        try {&lt;br /&gt;
            UIManager.setLookAndFeel(lafName);&lt;br /&gt;
        } catch (Exception e) {&lt;br /&gt;
            System.err.println(&amp;quot;Can&amp;quot;t set look &amp;amp; feel:&amp;quot; + e);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Creates and configures a frame, builds the menu bar, builds the&lt;br /&gt;
     * content, locates the frame on the screen, and finally shows the frame.&lt;br /&gt;
     */&lt;br /&gt;
    private void buildInterface() {&lt;br /&gt;
        JFrame frame = new JFrame();&lt;br /&gt;
        frame.setJMenuBar(buildMenuBar());&lt;br /&gt;
        frame.setContentPane(buildContentPane());&lt;br /&gt;
        frame.setSize(600, 400);&lt;br /&gt;
        locateOnScreen(frame);&lt;br /&gt;
        frame.setTitle(&amp;quot;JGoodies :: Tiny&amp;quot;);&lt;br /&gt;
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&lt;br /&gt;
        frame.setVisible(true);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Locates the frame on the screen center.&lt;br /&gt;
     */&lt;br /&gt;
    private void locateOnScreen(Frame frame) {&lt;br /&gt;
        Dimension paneSize   = frame.getSize();&lt;br /&gt;
        Dimension screenSize = frame.getToolkit().getScreenSize();&lt;br /&gt;
        frame.setLocation(&lt;br /&gt;
            (screenSize.width  - paneSize.width)  / 2,&lt;br /&gt;
            (screenSize.height - paneSize.height) / 2);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds and answers the menu bar.&lt;br /&gt;
     */&lt;br /&gt;
    private JMenuBar buildMenuBar() {&lt;br /&gt;
        JMenu menu;&lt;br /&gt;
        JMenuBar menuBar = new JMenuBar();&lt;br /&gt;
        menuBar.putClientProperty(Options.HEADER_STYLE_KEY, Boolean.TRUE);&lt;br /&gt;
        menu = new JMenu(&amp;quot;File&amp;quot;);&lt;br /&gt;
        menu.add(new JMenuItem(&amp;quot;New...&amp;quot;));&lt;br /&gt;
        menu.add(new JMenuItem(&amp;quot;Open...&amp;quot;));&lt;br /&gt;
        menu.add(new JMenuItem(&amp;quot;Save&amp;quot;));&lt;br /&gt;
        menu.addSeparator();&lt;br /&gt;
        menu.add(new JMenuItem(&amp;quot;Print...&amp;quot;));&lt;br /&gt;
        menuBar.add(menu);&lt;br /&gt;
        menu = new JMenu(&amp;quot;Edit&amp;quot;);&lt;br /&gt;
        menu.add(new JMenuItem(&amp;quot;Cut&amp;quot;));&lt;br /&gt;
        menu.add(new JMenuItem(&amp;quot;Copy&amp;quot;));&lt;br /&gt;
        menu.add(new JMenuItem(&amp;quot;Paste&amp;quot;));&lt;br /&gt;
        menuBar.add(menu);&lt;br /&gt;
        return menuBar;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds and answers the content pane.&lt;br /&gt;
     */&lt;br /&gt;
    private JComponent buildContentPane() {&lt;br /&gt;
        JPanel panel = new JPanel(new BorderLayout());&lt;br /&gt;
        panel.add(buildToolBar(), BorderLayout.NORTH);&lt;br /&gt;
        panel.add(buildSplitPane(), BorderLayout.CENTER);&lt;br /&gt;
        panel.add(buildStatusBar(), BorderLayout.SOUTH);&lt;br /&gt;
        return panel;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds and answers the tool bar.&lt;br /&gt;
     */&lt;br /&gt;
    private Component buildToolBar() {&lt;br /&gt;
        JToolBar toolBar = new JToolBar();&lt;br /&gt;
        toolBar.putClientProperty(Options.HEADER_STYLE_KEY, Boolean.TRUE);&lt;br /&gt;
        &lt;br /&gt;
        toolBar.add(createCenteredLabel(&amp;quot;Tool Bar&amp;quot;));&lt;br /&gt;
        return toolBar;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds and answers the split panel.&lt;br /&gt;
     */&lt;br /&gt;
    private Component buildSplitPane() {&lt;br /&gt;
        JSplitPane splitPane =&lt;br /&gt;
            new JSplitPane(&lt;br /&gt;
                JSplitPane.HORIZONTAL_SPLIT,&lt;br /&gt;
                buildSideBar(),&lt;br /&gt;
                buildMainPanel());&lt;br /&gt;
        return splitPane;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds and answers the side bar.&lt;br /&gt;
     */&lt;br /&gt;
    private Component buildSideBar() {&lt;br /&gt;
        return createStrippedScrollPane(new JTree());&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds and answers the main panel.&lt;br /&gt;
     */&lt;br /&gt;
    private Component buildMainPanel() {&lt;br /&gt;
        JEditorPane editor = new JEditorPane();&lt;br /&gt;
        editor.setText(&lt;br /&gt;
            &amp;quot;This is a minimal Swing application, that demos,\n&amp;quot; +&lt;br /&gt;
            &amp;quot;how to install and use a JGoodies look&amp;amp;feel\n&amp;quot; +&lt;br /&gt;
            &amp;quot;in a Swing application.&amp;quot;);&lt;br /&gt;
        return createStrippedScrollPane(editor);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Builds and answers the tool bar.&lt;br /&gt;
     */&lt;br /&gt;
    private Component buildStatusBar() {&lt;br /&gt;
        JPanel statusBar = new JPanel(new BorderLayout());&lt;br /&gt;
        statusBar.add(createCenteredLabel(&amp;quot;Status Bar&amp;quot;));&lt;br /&gt;
        return statusBar;&lt;br /&gt;
    }&lt;br /&gt;
    // Helper Code ********************************************************&lt;br /&gt;
    /**&lt;br /&gt;
     * Creates and answers a &amp;lt;code&amp;gt;JScrollpane&amp;lt;/code&amp;gt; that has no border.&lt;br /&gt;
     */&lt;br /&gt;
    private JScrollPane createStrippedScrollPane(Component c) {&lt;br /&gt;
        JScrollPane scrollPane = new JScrollPane(c);&lt;br /&gt;
        scrollPane.setBorder(null);&lt;br /&gt;
        return scrollPane;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Creates and answers a &amp;lt;code&amp;gt;JLabel&amp;lt;/code&amp;gt; that has the text&lt;br /&gt;
     * centered and that is wrapped with an empty border.&lt;br /&gt;
     */&lt;br /&gt;
    private Component createCenteredLabel(String text) {&lt;br /&gt;
        JLabel label = new JLabel(text);&lt;br /&gt;
        label.setHorizontalAlignment(SwingConstants.CENTER);&lt;br /&gt;
        label.setBorder(new EmptyBorder(3, 3, 3, 3));&lt;br /&gt;
        return label;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>