Hallo,
habe mal das JApplet ausprobiert. Dabei bekomme ich die Fehlermeldung: "access denied ("java.lang.RuntimePermission" "exitVM.0")"
Der Code:
JumpnRun
html code:
weiß jemand, wie sich diese Exception beheben kann?
habe mal das JApplet ausprobiert. Dabei bekomme ich die Fehlermeldung: "access denied ("java.lang.RuntimePermission" "exitVM.0")"
Der Code:
JumpnRun
Java:
import javax.swing.*;
public class JumpnRun extends JApplet {
/**
*
*/
private static final long serialVersionUID = 1L;
public JFrame frame;
public Screen screen;
public void init(){
String w = getParameter("width");
String h = getParameter("height");
frame = new JFrame();
frame.setSize(Integer.valueOf(w), Integer.valueOf(h));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
screen = new Screen(frame);
frame.add(screen);
}
public void start(){
}
public void stop(){
}
}
Java:
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
public class Screen extends JPanel implements ActionListener,Runnable {
/**
*
*/
private static final long serialVersionUID = 1L;
public int x,y;
public Thread t = new Thread(this);
public Screen(JFrame frame){
x = frame.getSize().width;
y = frame.getSize().height;
t.start();
this.addMouseListener(new Mouse());
this.addMouseMotionListener(new Mouse());
}
public void actionPerformed(ActionEvent e) {
}
public void paint(Graphics g){
g.drawRect(0, 0, x, y);
}
public void run() {
while(true){
repaint();
}
}
}
html code:
HTML:
<html>
<head>
<title>Game</title>
</head>
<body>
<applet archive="App.jar" code="JumpnRun.class" width=200 height=200>
<param name="width" value="200"
name="height" value="200"
</param>
</applet>
</body>
</html>
weiß jemand, wie sich diese Exception beheben kann?