import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Hope
{
public static void main(String args[])
{
new LDFrame();
}
}
class LDFrame extends JFrame
{
JTabbedPane jtp;
JPanel jp1,jp2,jp3;
LDFrame()
{
this.setSize(500,500);
this.setTitle("暑假任务.");
jp1=new JPanel();
jp1.setBackground(Color.GREEN);
jp2=new JPanel();
jp2.setBackground(Color.BLUE);
jp3=new JPanel();
jp3.setBackground(Color.WHITE);
jtp=new JTabbedPane();
jtp.add("绿色",jp1);
jtp.add("蓝色",jp2);
jtp.add("白色",jp3);
this.add(jtp,BorderLayout.CENTER);
this.setLocationRelativeTo(null);
this.setVisible(true);
}
}