📄 searchframe.java
字号:
package myprojects.studymanager;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class Searchframe extends JFrame implements ActionListener
{
JButton closeframe;
Searchframe(StudyManager frame)
{
this.setTitle("查找");
this.setSize(500,400);
Point p=frame.getLocation(); //定位dialog在母版中间
Dimension s=frame.getSize();
int x=(int)p.getX();
int y=(int)p.getY();
int sx=(int)s.getWidth();
int sy=(int)s.getHeight();
x=x+sx/2-300/2;
y=y+sy/2-200/2;
this.setLocation(x,y);
closeframe=new JButton("关闭");
closeframe.addActionListener(this);
Container cp=this.getContentPane();
cp.setLayout(new FlowLayout());
cp.add(new Search(closeframe));
this.setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
dispose();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -