-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.java
More file actions
71 lines (59 loc) · 1.63 KB
/
gui.java
File metadata and controls
71 lines (59 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import java.awt.FlowLayout;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.*;
import java.io.*;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.awt.event.*;
class FSE extends JFrame implements ActionListener {
JTextField tf;
JLabel jl;
JButton b;
JFrame jf;
JLabel d;
JTextField dirname;
JButton c;
public FSE()
{
//jf=new JFrame("File-Search-Engine");
this.setSize(400, 500);
this.setLayout(null);
jl=new JLabel("Filename");
jl.setBounds(10,40 , 100, 20);
this.add(jl);
tf=new JTextField();
tf.setBounds(10, 80, 100, 40);
this.add(tf);
d=new JLabel("Directory");
d.setBounds(10, 150, 100, 20);
this.add(d);
dirname=new JTextField();
dirname.setBounds(10, 200, 100, 40);
this.add(dirname);
b=new JButton("search");
b.setBounds(10, 250, 100, 20);
b.addActionListener(this);
this.add(b);
//c=new JButton("cancel");
//c.setBounds(140, 20, 100, 20);
//jf.add(c);
//c.addActionListener(this);
this.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
System.out.println("searching");
String filename=tf.getText();
//String all=new String("all");
String directory=dirname.getText();
System.out.println(directory);
filesearch s=new filesearch();
//s.findfile(new File(directory),filename);
s.start(new File(directory),filename);
}
}