Impossible de lire mon applet avec un navigateur

Impossible de lire mon applet avec un navigateur - Programmation

Marsh Posté le 07-02-2002 à 22:38:55    

Voici le code de l'applet
 
import java.awt.*;
 
public class IRChat extends javax.swing.JApplet
{
 String greeting;
 
 public void init() { greeting = "Salut"; }
 public void start() { greeting = "Bonjour"; }
 public void paint(Graphics screen)
 {
  Graphics2D screen2D = (Graphics2D)screen;
  screen2D.drawString(greeting,25,50);
 }
}
 
Et le navigateur affiche dans la barre d'état :
exception : access denied (java.lang.RuntimePermission modifyThreadGroup)

Reply

Marsh Posté le 07-02-2002 à 22:38:55   

Reply

Marsh Posté le 13-02-2002 à 11:42:48    

C'est puisque tu utilises une JApplet et non une Applet. Si ton navigateur n'a pas le plug-in JFC, tu peux pas faire tourner ton Applet.

Reply

Marsh Posté le 13-02-2002 à 12:07:52    

Olivier51 a écrit a écrit :

Voici le code de l'applet
 
import java.awt.*;
 
public class IRChat extends javax.swing.JApplet
{
 String greeting;
 
 public void init() { greeting = "Salut"; }
 public void start() { greeting = "Bonjour"; }
 public void paint(Graphics screen)
 {
  Graphics2D screen2D = (Graphics2D)screen;
  screen2D.drawString(greeting,25,50);
 }
}
 
Et le navigateur affiche dans la barre d'état :
exception : access denied (java.lang.RuntimePermission modifyThreadGroup)  




 
essaie ca

Code :
  1. import java.awt.*;
  2. public class IRChat extends Applet
  3. {
  4. String greeting;
  5. public void init() { greeting = "Salut"; }
  6. public void start() { greeting = "Bonjour"; }
  7. public void paint(Graphics screen)
  8. {
  9.  Graphics2D screen2D = (Graphics2D)screen;
  10.  screen2D.drawString(greeting,25,50);
  11. }
  12. }


---------------
What is popular is not always right, what is right is not always popular :D
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed