日期:2014-05-20 浏览次数:20860 次
/**
* Adds a <code>component</code> and <code>tip</code>
* represented by a <code>title</code> and/or <code>icon</code>,
* either of which can be <code>null</code>.
* Cover method for <code>insertTab</code>.
*
* @param title the title to be displayed in this tab
* @param icon the icon to be displayed in this tab
* @param component the component to be displayed when this tab is clicked
* @param tip the tooltip to be displayed for this tab
*
* @see #insertTab
* @see #removeTabAt
*/
public void addTab(String title, Icon icon, Component component, String tip) {
insertTab(title, icon, component, tip, pages.size());
}
import javax.swing.JFrame;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import java.awt.FlowLayout;
import javax.swing.JButton;
import java.awt.Container;
import java.awt.Color;
import java.awt.Font;
import java.awt.CardLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JLabel;
public class FrameTest extends JFrame