Popular Posts
ListSelectionListener & ItemListener import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Toolkit; import java.awt.event.ItemEvent; import java.awt.event.ItemL... netbean shortcut Ctrl + F:尋找 F3:尋找下一個字串 Ctrl + G:跳到第 N 行 Ctrl + H:取代 Tab:增加縮排 Shift + Tab:減少縮排 Ctrl + E:刪除一行 Ctrl + Shift + I:修正 import 項目 Alt + Ent... Capture response output stream using HttpModule using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Web; namespace TestWebA...
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);
    }

}