Biblioteca Java - Blame information for rev 3
Subversion Repositories:
Rev | Author | Line No. | Line |
---|---|---|---|
3 | mihai | 1 | /* |
2 | * DisplayHTML.java | ||
3 | */ | ||
4 | |||
5 | /** | ||
6 | * Class created by @author Mihai HULEA at Feb 25, 2005. | ||
7 | * | ||
8 | * This class is part of the laborator2_net project. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | package lab.scd.net.displayhtml; | ||
13 | import javax.swing.*; | ||
14 | import java.io.*; | ||
15 | |||
16 | public class DisplayHTML { | ||
17 | |||
18 | public static void main(String[] args) { | ||
19 | |||
20 | JEditorPane jep = new JEditorPane( ); | ||
21 | jep.setEditable(false); | ||
22 | |||
23 | try { | ||
24 | jep.setPage("http://www.personal.ro"); | ||
25 | } | ||
26 | catch (IOException e) { | ||
27 | jep.setContentType("text/html"); | ||
28 | jep.setText("<html>Could not load http://www.personal.ro</html>"); | ||
29 | } | ||
30 | |||
31 | JScrollPane scrollPane = new JScrollPane(jep); | ||
32 | JFrame f = new JFrame("Test loading html page"); | ||
33 | |||
34 | f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); | ||
35 | f.setContentPane(scrollPane); | ||
36 | f.setSize(512, 342); | ||
37 | f.setVisible(true); | ||
38 | |||
39 | } | ||
40 | } |