1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| import javax.swing.*;
import java.io.*;
public class DisplayWebPage extends JFrame
{
public static void main(String[] args)
{
JEditorPane editor = new JEditorPane();
editor.setEditable(false);
editor.setContentType("text/html");
try {
editor.setPage("https://telecharger-freeware.com//modules/logiciel-gratuit/singlefile.php?cid=8&lid=1553");
} catch (IOException e) {editor.setText("La page n'a pas pû chargée !");}
JScrollPane scrollPane = new JScrollPane(editor);
JFrame f = new JFrame("Afficher la page web.");
f.getContentPane().add(scrollPane);
f.setSize(700,400);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
} |
Partager