资源简介
自己写的一个座位排序的小程序,不是很完善,不过也可以用了。
代码片段和文件信息
import java.awt.BorderLayout;
import java.awt.Label;
import java.awt.Button;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.frame;
import java.awt.Graphics;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.StringTokenizer;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.Jframe;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
class Myframe extends Jframe implements ActionListener
{
JButton button1 /*button2*/ button3 button4 button5;
JPanel myjpanel;
JTextArea text;
Box boxh;
JSplitPane mysplit;
MyDialog dialog;
Container contentpane;
Mycanvas Mycan = new Mycanvas();
int hangsh rensh;
static int y;
public static String[] paixu(String out[] String in[])
{
if (out.length % 2 == 1)
{
int k = (out.length - 1) / 2;
out[k] = in[0];
for (int j = 0; j < k; j++)
{
out[j] = in[2 * (k - j)];
out[2 * k - j] = in[2 * (k - j) - 1];
}
} else
{
int k = out.length / 2;
for (int j = 0; j < k; j++)
{
out[j] = in[2 * (k - j) - 1];
out[2 * k - j - 1] = in[2 * (k - j - 1)];
}
}
return out;
}
public Myframe()
{
button1 = new JButton(“生成座次表“);
//button2 = new JButton(“添加普通与会人员“);
button3 = new JButton(“设置“);
button4 = new JButton(“打印预览“);
button5 = new JButton(“打印“);
myjpanel = new JPanel();
button1.addActionListener(this);
//button2.addActionListener(this);
button3.addActionListener(this);
button4.addActionListener(this);
button5.addActionListener(this);
text = new JTextArea(20 20);
text.setSize(280 20);
boxh = Box.createHorizontalBox();
boxh.add(button1);
//boxh.add(button2);
boxh.add(button3);
boxh.add(button4);
boxh.add(button5);
mysplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT text Mycan);
mysplit.setDividerLocation(120);
Jframe jframe = new Jframe(“会场排座0.1“);
jframe.setSize(480 600);
jframe.setBackground(Color.blue);
jframe.setVisible(true);// jframe.pack();
dialog = new MyDialog(jframe “每排人数和排数“ true);
jframe.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
contentpane = jframe.getContentPane();
contentpane.add(boxh BorderLayout.NO
- 上一篇:xm
l-apis-2.0.2.jar - 下一篇:java经典50例题
评论
共有 条评论