Popular Posts
javax.net.ssl.SSLHandshakeException: Connection closed by peer in Android 5.0 Lollipop Recently, there is a error occurs when access website via ssl connection like below although it worked fine several days ago. // Enable SSL... SwiXml SwiX ml , is a small GUI generating engine for Java applications and applets. Graphical User Interfaces are described in XML documents that ... executeOrDelayUntilScriptLoaded Executes the specified function if the file containing it is loaded; otherwise, adds it to the pending job queue. ExecuteOrDelayUntilScrip...
Stats
SwiXml - TabbedPane
TabbedPane.xml
<?xml version="1.0" encoding="UTF-8"?>
<panel layout="BorderLayout">
    <label text="TabbedPane sample" constraints="BorderLayout.NORTH" />
    <tabbedpane>
        <panel name="Tab 1" layout="FlowLayout(FlowLayout.LEFT)">
            <label text="Blue content" foreground="0000FF" font="BOLD-30" />
        </panel>
        <panel name="Tab 2" layout="FlowLayout(FlowLayout.LEFT)">
            <label text="Green content" foreground="00FF00" font="BOLD-30" />
        </panel>
        <panel name="Tab 3" layout="FlowLayout(FlowLayout.LEFT)">
            <label text="Red content" foreground="FF0000" font="BOLD-30" />
        </panel>
    </tabbedpane>
</panel>
TabbedPane.java
package swixml.sample;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import org.swixml.SwingEngine;

public class TabbedPane extends JPanel {

    public TabbedPane() {
        try {
            new SwingEngine(this).insert("swixml/sample/TabbedPane.xml", this);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    /**
     * @param args
     */
    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InstantiationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (UnsupportedLookAndFeelException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setTitle("SwiXML - TabbedPane");

        frame.setContentPane(new TabbedPane());
        frame.pack();

        Dimension sc = Toolkit.getDefaultToolkit().getScreenSize();
        frame.setLocation((sc.width - frame.getWidth()) / 2, (sc.height - frame.getHeight()) / 2);
        frame.setVisible(true);
    }

}