-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelp.java
79 lines (77 loc) · 2.17 KB
/
help.java
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
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.zip.*;
import java.util.zip.ZipEntry.*;
import java.io.IOException;
import java.io.*;
import javax.swing.table.*;
import javax.swing.border.*;
import java.util.*;
import javax.swing.filechooser.FileSystemView;
import javax.swing.tree.*;
import java.util.*;
import java.text.*;
import java.net.URL;
public class help extends javax.swing.JFrame
{
JEditorPane ep;
JScrollPane sp;
JButton b;
URL urls[],temp[];
JPanel p;
help()
{
super("Help -PowerZip");
ep=new JEditorPane();
ep.setEditable(false);
ep.addHyperlinkListener(new HyperlinkListener()
{
public void hyperlinkUpdate(HyperlinkEvent he)
{
if(he.getEventType()==HyperlinkEvent.EventType.ACTIVATED)
{
try
{
openpage(he.getURL());
}
catch(Exception e){}
}
}
});
sp=new JScrollPane(ep,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
b=new JButton("OK");
b.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
setVisible(false);
}
});
p=new JPanel(new FlowLayout());
p.add(b);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(p,BorderLayout.SOUTH);
getContentPane().add(sp,BorderLayout.CENTER);
String url1 = "file:" + System.getProperty("user.dir") +System.getProperty("file.separator") +"help.html";
try
{
ep.setPage(url1);
}
catch(Exception e)
{
}
}
public void openpage(URL url)
{
try
{
ep.setPage(url);
}
catch(IOException ex2)
{
JOptionPane.showMessageDialog((Container)null,"Unable to locate the help file!!","PowerZip 1.0",JOptionPane.OK_OPTION);
}
}
}