📄 addselect.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -