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
| import java.awt.BorderLayout;
import java.awt.Color;
import java.io.*;
import javax.swing.JApplet;
import javax.swing.JLabel;
public class lecteurApplet extends JApplet
{
private static final long serialVersionUID = 1L;
private JLabel label = new JLabel();
public static void vlc(String lien)
{
Runtime runtime = Runtime.getRuntime();
try
{
runtime.exec("\"C:/Program Files (x86)/VideoLAN/VLC/vlc.exe"+"\""+ lien+"\"");
}
catch (IOException e)
{
e.printStackTrace();
}
}
public void JavaScriptExec(String l)
{
vlc(l);
label.setText(l);
}
public void init()
{
this.setSize(300, 200);
label.setHorizontalAlignment(JLabel.CENTER);
label.setForeground(Color.blue);
this.getContentPane().add(label, BorderLayout.NORTH);
}
} |