62,623
社区成员
发帖
与我相关
我的任务
分享
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import java.awt.Color;
public class MyFrame extends JFrame {
private static final long serialVersionUID = 1L;
/**
* This is the default constructor
*/
public MyFrame() {
super();
this.getContentPane().setLayout(new BorderLayout());
this.getContentPane().add(new MyPanel("aaaaa"),BorderLayout.WEST);
this.getContentPane().add(new MyPanel("bbbbb"),BorderLayout.CENTER);
//this.getContentPane().add(new AAA(),BorderLayout.CENTER);
//this.getContentPane().add(myTabbedPane);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setForeground(Color.white);
this.setBackground(Color.white);
this.setResizable(true);
this.setSize(new Dimension(800, 600));
this.setTitle("演示程序");
show();
}
/**
* This method initializes this
*
* @return void
*/
public static void main(String args[]){
MyFrame f=new MyFrame();
}
} // @jve:decl-index=0:visual-constraint="10,10"
import javax.swing.*;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
import java.awt.*;
class MyPanel extends JPanel {//根据当前时间画一个坐标轴
/**
* This is the default constructor
*/
public MyPanel(String s) {
JLabel lb=new JLabel(s);
lb.setBounds(50,20,300,100);
add(lb);
Border border=BorderFactory.createBevelBorder(BevelBorder.RAISED,new Color(122,138,153),new Color(54,71,89));
setBorder(border);
}
}