Popular Posts
Start/stop oracle REM This batch file is used to start/stop the oracle instance REM Simply invoke oracle.bat start/stop cls @ECHO off REM ********************... SwiXml - JTextBox (Customized JTextField) LimitedDocument.java package swixml.sample; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import jav... Tick Start tick Java Javascript .net Tick = 0 (GMT+0) 1970/01/01 00:00:00 1970/01/01 00:00:00 1601/01/01 00:00:00...
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);
    }

}