-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarvellousUnpackFront.java
More file actions
99 lines (86 loc) · 2.94 KB
/
MarvellousUnpackFront.java
File metadata and controls
99 lines (86 loc) · 2.94 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;
class InvaliFileException extends Exception
{
public InvaliFileException(String str)
{
super(str);
}
}
public class MarvellousUnpackFront extends Template implements ActionListener
{
JButton SUBMIT , PREVIOUS;
JLabel label1,label2,title;
final JTextField text1;
public MarvellousUnpackFront()
{
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
title = new JLabel("UnPacking 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("File 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 ");
SUBMIT = new JButton("Extract Here");
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(text1);
_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{
MarvellousUnpack obj = new MarvellousUnpack(text1.getText());
this.dispose();
NextPage t = new NextPage("admin");
}
catch(InvaliFileException obj)
{
this.setVisible(false);
this.dispose();
JOptionPane.showMessageDialog(this, "Invalid Packed File","Error",JOptionPane.ERROR_MESSAGE);
NextPage t = new NextPage("MarvellousAdmin");
}
catch(Exception e)
{}
}
if( ae.getSource() == PREVIOUS)
{
this.setVisible(false);
this.dispose();
NextPage t = new NextPage("admin");
}
}
}