import java.awt.*;
import javax.swing.*;
public class Jxxk extends JFrame
{
private JTabbedPane tabbedPane;
private JLabel label1,label2,label3;
private JPanel panel1,panel2,panel3;
public Jxxk(){
super();
Container c=getContentPane();
tabbedPane=new JTabbedPane();
label1=new JLabel("this one",SwingConstants.CENTER);
label2=new JLabel("this two",SwingConstants.CENTER);
label3=new JLabel("this three",SwingConstants.CENTER);
panel1=new JPanel();
panel2=new JPanel();
panel3=new JPanel();
panel1.add(label1);
panel2.add(label2);
panel3.add(label3);
panel1.setBackground(Color.yellow);
panel2.setBackground(Color.blue);
panel3.setBackground(Color.green);
tabbedPane.addTab("B1",null,panel1,"First panel");
tabbedPane.addTab("B2",null,panel2,"Second panel");
tabbedPane.addTab("B3",null,panel3,"Third panel");
tabbedPane.setBackground(Color.white);
c.add(tabbedPane);
c.setBackground(Color.white);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args){
Jxxk d=new Jxxk();
}
}
import javax.swing.*;
public class Jxxk extends JFrame
{
private JTabbedPane tabbedPane;
private JLabel label1,label2,label3;
private JPanel panel1,panel2,panel3;
public Jxxk(){
super();
Container c=getContentPane();
tabbedPane=new JTabbedPane();
label1=new JLabel("this one",SwingConstants.CENTER);
label2=new JLabel("this two",SwingConstants.CENTER);
label3=new JLabel("this three",SwingConstants.CENTER);
panel1=new JPanel();
panel2=new JPanel();
panel3=new JPanel();
panel1.add(label1);
panel2.add(label2);
panel3.add(label3);
panel1.setBackground(Color.yellow);
panel2.setBackground(Color.blue);
panel3.setBackground(Color.green);
tabbedPane.addTab("B1",null,panel1,"First panel");
tabbedPane.addTab("B2",null,panel2,"Second panel");
tabbedPane.addTab("B3",null,panel3,"Third panel");
tabbedPane.setBackground(Color.white);
c.add(tabbedPane);
c.setBackground(Color.white);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args){
Jxxk d=new Jxxk();
}
}