addselect.java
来自「JAVA CLONE 用于CLASS范式的CLONE」· Java 代码 · 共 48 行
JAVA
48 行
package frame;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
public class AddSelect extends JFrame{
public AddSelect(final ManagerSystem jfram)
{
JButton cnewclass=new JButton("add class");
cnewclass.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new AddNewClass(jfram);
}});
JButton newstudent=new JButton("add sutent");
newstudent.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new AddNewStudent(jfram);
}});
JButton newcourse=new JButton("addd course");
newcourse.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}});
Container con=this.getContentPane();
con.setLayout(new FlowLayout());
con.add(cnewclass);
con.add(newstudent);
con.add(newcourse);
initSizeAndLocation(this,200,200);
this.setVisible(true);
}
public static void initSizeAndLocation(Window window, int w, int h) {
window.setSize(w, h);
Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
window.setLocation(size.width / 2 - w / 2, size.height / 2 - h / 2);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?