Salve ragazzi, ho il seguente problema:
Ho creato una semplice pagina Access.html al cui interno viene richiamata un'applet; la pagina .html è la seguente:
codice:
<html>
<head>
<title>Sito registrazione</title>
</head>
<body bgcolor="#FFFFFF">
<applet code="Access.class" width="320" height="30">
</applet>
</body>
</html>
la pagina Access.class è invece la seguente:
codice:
import javax.swing.JButton;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.URI;
import java.net.URL;
import java.io.File;
import com.birosoft.liquid.*;
public class Access extends JApplet {
protected JButton myUpload ;
protected AuthenticationFrame myAuthenticationFrame;
protected JoBFrame myJoBFrame;
protected UploadFileFrame myUploadFileFrame;
protected JButton myConnect;
protected JButton register;
protected Access myApplet;
public static String codebase;
public void init () {
codebase = getCodeBase ().toString ();
if (! new File(System.getProperty ("user.home")
+"/plugins").exists())
new File(System.getProperty ("user.home")
+"/plugins").mkdir();
try{
UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");
} catch (Exception e) { e.printStackTrace();}
myApplet = this;
getContentPane().setBackground(new Color(255,255,255));
getContentPane().setLayout(new GraphPaperLayout(new Dimension(3,1),7,1));
myConnect = new JButton("Connect");
register = new JButton("Register");
myConnect.setActionCommand("Connect");
myConnect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if(event.getActionCommand() == "Connect" ) {
myAuthenticationFrame = new AuthenticationFrame(myApplet);
myAuthenticationFrame.pack();
myAuthenticationFrame.setVisible(true);
}
}
});
getContentPane().add(myConnect, new Rectangle(1,0,1,1));
register.setActionCommand("Register");
register.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if(event.getActionCommand() == "Register" ) {
RegistrationFrame registrationFrame = new RegistrationFrame("Registration");
registrationFrame.pack();
registrationFrame.setVisible(true);
}
}
});
getContentPane().add(register, new Rectangle(0,0,1,1));
}
public AuthenticationFrame getAuthenticationFrame() { return myAuthenticationFrame; }
}
Ecco il problema: l'applet nn viene caricata.
Quale può essere il problema, premetto che la classe Access.java si trova nella stessa directory in cui è presente Access.html