62,614
社区成员
发帖
与我相关
我的任务
分享
import java.awt.*;
import javax.swing.*;
public class FrameTest extends JFrame{
private JPanel bkgPan;
private JTextField dateJText;
public FrameTest(){
this.setLayout(null);
dateJText = new JTextField();
dateJText.setBounds(30,30,150,30);
//不设置文本框的字体,就不会出现闪白情况
dateJText.setFont(new Font("微软雅黑", Font.PLAIN, 14));
this.add(dateJText);
this.setSize(500,300);
this.setVisible(true);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new FrameTest();
}
}