Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    [AppletJava] nn si carica

    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

  2. #2
    Utente di HTML.it
    Registrato dal
    Aug 2002
    Messaggi
    8,013
    Bhè, a occhio direi che hai problemi di sicurezza: non puoi mica andare a leggere e scrivere ciò che vuoi e dove vuoi nel client a meno che non si tratte di applet firmata e che l'utente abbia consentito espressamente all'applet di fare le letture/scritture previste.
    <´¯)(¯`¤._)(¯`»ANDREA«´¯)(_.¤´¯)(¯`>
    "The answer to your question is: welcome to tomorrow"

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.