标签:empty main you 和我 arc 能力 方式 任务 inf
代码链接:coding
package org.eclipse.wb.swing;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import org.omg.PortableServer.RequestProcessingPolicyValue;
import javax.swing.JLabel;
import javax.swing.JCheckBox;
import java.awt.Font;
import java.awt.Panel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.ItemListener;
import java.awt.event.ItemEvent;
import javax.swing.JTextArea;
import java.awt.TextField;
import java.awt.Toolkit;
import java.awt.List;
import javax.swing.JButton;
import javax.swing.JToggleButton;
import javax.swing.JTextField;
import javax.swing.JList;
import java.awt.ScrollPane;
public class HelloWorld extends JFrame {
private JPanel contentPane;
private JTextField fanwei;
private JTextField shuliang;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
HelloWorld frame = new HelloWorld();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public HelloWorld() {
setTitle("\u56DB\u5219\u8FD0\u7B97\u81EA\u52A8\u751F\u6210");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(null);
setContentPane(contentPane);
JCheckBox chckbxNewCheckBox = new JCheckBox("\u52A0\u6CD5");
chckbxNewCheckBox.setFont(new Font("楷体", Font.PLAIN, 22));
contentPane.add(chckbxNewCheckBox, BorderLayout.WEST);
JCheckBox jiafa = new JCheckBox("\u52A0\u6CD5");
jiafa.setFont(new Font("楷体", Font.PLAIN, 20));
jiafa.setBounds(6, 6, 65, 23);
contentPane.add(jiafa);
JCheckBox jianfa = new JCheckBox("\u51CF\u6CD5");
jianfa.setFont(new Font("楷体", Font.PLAIN, 20));
jianfa.setBounds(73, 6, 65, 23);
contentPane.add(jianfa);
JCheckBox chengfa = new JCheckBox("\u4E58\u6CD5");
chengfa.setFont(new Font("楷体", Font.PLAIN, 20));
chengfa.setBounds(140, 6, 65, 23);
contentPane.add(chengfa);
JCheckBox chufa = new JCheckBox("\u9664\u6CD5");
chufa.setFont(new Font("楷体", Font.PLAIN, 20));
chufa.setBounds(207, 6, 65, 23);
contentPane.add(chufa);
JCheckBox kuohao = new JCheckBox("\u62EC\u53F7");
kuohao.setFont(new Font("楷体", Font.PLAIN, 20));
kuohao.setBounds(344, 6, 65, 23);
contentPane.add(kuohao);
JCheckBox xiaoshu = new JCheckBox("\u5C0F\u6570");
xiaoshu.setFont(new Font("楷体", Font.PLAIN, 20));
xiaoshu.setBounds(277, 6, 65, 23);
contentPane.add(xiaoshu);
JLabel lblNewLabel = new JLabel("\u6570\u503C\u8303\u56F4");
lblNewLabel.setFont(new Font("楷体", Font.PLAIN, 20));
lblNewLabel.setBounds(10, 42, 80, 28);
contentPane.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("\u9898\u76EE\u6570\u91CF");
lblNewLabel_1.setFont(new Font("楷体", Font.PLAIN, 20));
lblNewLabel_1.setBounds(207, 45, 91, 23);
contentPane.add(lblNewLabel_1);
JToggleButton button = new JToggleButton("\u751F\u6210\u7B97\u5F0F");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
String n1 = fanwei.getText();
int num = Integer.parseInt(n1);
String n2 = shuliang.getText();
int max = Integer.parseInt(n2);
int[] a = {0,0,0,0};
int kh=0,outp=0,xs=0;
if(jiafa.isSelected())
a[0] = 1;
if(jianfa.isSelected())
a[1] = 1;
if(chengfa.isSelected())
a[2] = 1;
if(chufa.isSelected())
a[3] = 1;
if(kuohao.isSelected()) {
kh = 1;
}else {
kh = 0;
}
if(xiaoshu.isSelected()) {
xs = 1;
}else {
xs = 0;
}
shuchu.aa(num,max,a,kh,xs);
}
});
button.setFont(new Font("楷体", Font.PLAIN, 20));
button.setBounds(6, 95, 132, 38);
contentPane.add(button);
fanwei = new JTextField();
fanwei.setBounds(100, 48, 80, 21);
contentPane.add(fanwei);
fanwei.setColumns(10);
shuliang = new JTextField();
shuliang.setBounds(308, 48, 80, 21);
contentPane.add(shuliang);
shuliang.setColumns(10);
}
private void RequestProcessingPolicyValue(String string) {
// TODO Auto-generated method stub
}
}
标签:empty main you 和我 arc 能力 方式 任务 inf
原文地址:https://www.cnblogs.com/linlu/p/8869418.html