JFrame UI

package frame;

import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class UIFrame {

private JFrame frame = null;
private JButton runButton = null;
private JButton cancelButton = null;
private JCheckBox resChkbox = null;
private JCheckBox tempChkbox = null;
private JCheckBox dailyChkbox = null;
private JCheckBox sqliteChkbox = null;
private JComboBox levelComboBox = null;
private JTextField daysField = null;
private JTextField dateField = null;
private JTextField id = null;
private JTextField daysSqlField = null;
private JTextField dateSqlField = null;
private JTextField idSql = null;
private JScrollPane scrollPane = null;
private JTextArea console=null;
private JPanel topPanel = null;
private JPanel buttomPanel = null;

String[] levels = { "50W", "100W", "150W", "200W", "250W", "300W", "350W",
"400W" };

public UIFrame() {

frame = new JFrame("N2510数据构造系统");
Container contentPane = frame.getContentPane();
contentPane.setLayout(new GridLayout(2,1));
runButton = new JButton("开始..");
cancelButton = new JButton("取消..");
resChkbox = new JCheckBox("资源构造");
tempChkbox = new JCheckBox("模板信息构造");
dailyChkbox = new JCheckBox("日数据构造");
sqliteChkbox = new JCheckBox("SQLite数据构造");
levelComboBox = new JComboBox(levels);
daysField = new JTextField("生产天数");daysField.setSize(80, 80);
dateField = new JTextField("开始日期");dateField.setSize(80, 80);
id = new JTextField("增量序列");id.setSize(60, 40);
daysSqlField = new JTextField("生产天数");
dateSqlField = new JTextField("开始日期");
idSql = new JTextField("增量序列");
scrollPane = new JScrollPane();
console=new JTextArea();
topPanel = new JPanel();
topPanel.setLayout(new GridLayout(6, 4));
topPanel.add(resChkbox);
topPanel.add(levelComboBox);
topPanel.add(new JLabel(" "));
topPanel.add(tempChkbox);
topPanel.add(new JLabel(" "));
topPanel.add(new JLabel(" "));
topPanel.add(dailyChkbox);
topPanel.add(dateField);
topPanel.add(daysField);
topPanel.add(id);
topPanel.add(new JLabel(" "));
topPanel.add(new JLabel(" "));
topPanel.add(sqliteChkbox);
topPanel.add(daysSqlField);
topPanel.add(dateSqlField);
topPanel.add(idSql);
topPanel.add(new JLabel());
topPanel.setBorder(BorderFactory.createTitledBorder("请选择生产项目"));
buttomPanel= new JPanel();
buttomPanel.setLayout(new GridLayout(1, 1));
buttomPanel.setBorder(BorderFactory.createTitledBorder("请查看控制台信息"));
//scrollPane.add(console);
console.setAutoscrolls(true);
buttomPanel.add(console);
contentPane.add(topPanel);
contentPane.add(buttomPanel);
contentPane.setEnabled(true);
frame.pack();
frame.show();
frame.setSize(600, 500);
frame.setVisible(true);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}

public static void main(String args[]) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
UIManager.setLookAndFeel("com.jtattoo.plaf.mcwin.McWinLookAndFeel");
new UIFrame();
UIManager.setLookAndFeel("com.jtattoo.plaf.aluminium.AluminiumLookAndFeel");

}

}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值