-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackFront.java
More file actions
101 lines (82 loc) · 2.68 KB
/
Copy pathPackFront.java
File metadata and controls
101 lines (82 loc) · 2.68 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class PackFront extends Template implements ActionListener
{
JButton SUBMIT, PREVIOUS;
JLabel label1,label2,title;
final JTextField text1,text2;
public PackFront()
{
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
title = new JLabel(" Packing Portal");
Dimension size = title.getPreferredSize();
title.setBounds(40,50,size.width+60,size.height);
title.setFont(new Font("Century",Font.BOLD,17));
title.setForeground(Color.blue);
label1 = new JLabel();
label1.setText("Directory Name");
label1.setForeground(Color.white);
label1.setBounds(350,50,size.width,size.height);
text1 = new JTextField(15);
Dimension tsize = text1.getPreferredSize();
text1.setBounds(500,50,tsize.width,tsize.height);
text1.setToolTipText("Enter name of Directory ");
label2 = new JLabel();
label2.setText("Destination File Name");
label2.setForeground(Color.white);
label2.setBounds(350,100,size.width,size.height);
text2 = new JTextField(15);
text2.setBounds(500,100,tsize.width,tsize.height);
text2.setToolTipText("Enter Destination file name");
SUBMIT = new JButton("SUBMIT");
Dimension bsize = SUBMIT.getPreferredSize();
SUBMIT.setBounds(350,200,bsize.width,bsize.height);
SUBMIT.addActionListener(this);
PREVIOUS = new JButton("PREVIOUS");
Dimension b2size = PREVIOUS.getPreferredSize();
PREVIOUS.setBounds(500,200,b2size.width,b2size.height);
PREVIOUS.addActionListener(this);
_header.add(title);
_content.add(label1);
_content.add(label2);
_content.add(text1);
_content.add(text2);
_content.add(SUBMIT);
_content.add(PREVIOUS);
this.setSize(1000,400);
this.setResizable(false);
this.setVisible(true);
text1.requestFocusInWindow();
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource() == exit)
{
this.setVisible(false);
System.exit(0);
}
if(ae.getSource() == minimize)
{
this.setState(this.ICONIFIED);
}
if(ae.getSource() == SUBMIT)
{
try
{
Packer obj = new Packer(text1.getText(),text2.getText());
this.dispose();
NextPage t = new NextPage("Admine");
}
catch(Exception e)
{}
}
if(ae.getSource() == PREVIOUS)
{
this.setVisible(false);
this.dispose();
NextPage t = new NextPage("Admine");
}
}
}