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

    Applet Java su localhost

    Ho un problema con una applet java:
    in pratica lo stesso file (quello con la applet) se lo apro con il doppio click (cioè C:\...) lo apre tranquillamente, mentre se lo apro dal server locale (http://localhost/...) mi dice che il file.class non è stato trovato.
    Ho controllato tutti i percorsi e sono giusti.
    Qual è il problema??
    Fatemi sapere, Grazie
    Paolo

  2. #2
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Benvenuto sul forum

    Purtroppo questa domanda non ha molta attinenza con gli argomenti trattati in questa sezione... ma posso ipotizzare ... prova ad indirizzare la pagina con http://127.0.0.1/...

    Oppure fornisci maggiori informazioni.

    ciao
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  3. #3
    il fatto è che la pagina la apre: è solo l'applet java che da errore.
    però la stessa pagina aperta con C:\.. non da problemi..
    boh??

  4. #4
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Originariamente inviato da br1
    fornisci maggiori informazioni.
    qualche dettaglio? di che applet si tratta? come la richiami? quali sono i parametri? la puoi pubblicare affinche' la si possa testare?

    altrimenti... e' come visitare un paziente per posta

    ciao
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  5. #5
    Eccoti il file .java e il file .html dove viene richiamto l'applet.
    Il file .html è una prova: in quello che uso, al posto dei valori stabiliti ci sono valori provenienti da un recordset.
    Il problema però si verifica anche con questo file.

    QUESTO E' IL FILE GRAPHER.JAVA

    package Graficatore;

    import javax.swing.JLabel;

    public class Grapher extends javax.swing.JApplet {

    private JLabel[] verde1;
    private JLabel[] azzurro2;
    private JLabel[] blu3;
    private JLabel[] rosso4;

    public void init() {
    initComponents();
    int numV = Integer.parseInt(getParameter("fa1"));
    int numA = Integer.parseInt(getParameter("fa2"));
    int numB = Integer.parseInt(getParameter("fa3"));
    int numR = Integer.parseInt(getParameter("fa4"));
    verde1 = new JLabel[] { jLabel2, jLabel3, jLabel5, jLabel4, jLabel6,
    jLabel7, jLabel11, jLabel10, jLabel8, jLabel9 };
    azzurro2 = new JLabel[] { jLabel12, jLabel13, jLabel15, jLabel14,
    jLabel16, jLabel17, jLabel21, jLabel20,
    jLabel18, jLabel19 };
    blu3 = new JLabel[] { jLabel22, jLabel23, jLabel25, jLabel24, jLabel26,
    jLabel27, jLabel31, jLabel30, jLabel28, jLabel29 };
    rosso4 = new JLabel[] { jLabel32, jLabel33, jLabel35, jLabel34, jLabel36,
    jLabel37, jLabel41, jLabel40, jLabel38, jLabel39 };
    for (int i = 0; i < 10; i++) {
    if (i >= numV)
    verde1[i].setVisible(false);
    if (i >= numA)
    azzurro2[i].setVisible(false);
    if (i >= numB)
    blu3[i].setVisible(false);
    if (i >= numR)
    rosso4[i].setVisible(false);
    }
    }

    private void initComponents() {//GEN-BEGIN:initComponents
    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    jLabel9 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    jLabel12 = new javax.swing.JLabel();
    jLabel13 = new javax.swing.JLabel();
    jLabel14 = new javax.swing.JLabel();
    jLabel15 = new javax.swing.JLabel();
    jLabel16 = new javax.swing.JLabel();
    jLabel17 = new javax.swing.JLabel();
    jLabel18 = new javax.swing.JLabel();
    jLabel19 = new javax.swing.JLabel();
    jLabel20 = new javax.swing.JLabel();
    jLabel21 = new javax.swing.JLabel();
    jLabel22 = new javax.swing.JLabel();
    jLabel23 = new javax.swing.JLabel();
    jLabel24 = new javax.swing.JLabel();
    jLabel25 = new javax.swing.JLabel();
    jLabel26 = new javax.swing.JLabel();
    jLabel27 = new javax.swing.JLabel();
    jLabel28 = new javax.swing.JLabel();
    jLabel29 = new javax.swing.JLabel();
    jLabel30 = new javax.swing.JLabel();
    jLabel31 = new javax.swing.JLabel();
    jLabel32 = new javax.swing.JLabel();
    jLabel33 = new javax.swing.JLabel();
    jLabel34 = new javax.swing.JLabel();
    jLabel35 = new javax.swing.JLabel();
    jLabel36 = new javax.swing.JLabel();
    jLabel37 = new javax.swing.JLabel();
    jLabel38 = new javax.swing.JLabel();
    jLabel39 = new javax.swing.JLabel();
    jLabel40 = new javax.swing.JLabel();
    jLabel41 = new javax.swing.JLabel();

    jPanel1.setLayout(null);

    jPanel1.setBackground(new java.awt.Color(248, 253, 181));
    jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/Blank.png")));
    jPanel1.add(jLabel1);
    jLabel1.setBounds(10, 10, 250, 220);

    jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaVerde.png")));
    jPanel1.add(jLabel2);
    jLabel2.setBounds(38, 180, 36, 14);

    jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaVerde.png")));
    jPanel1.add(jLabel3);
    jLabel3.setBounds(38, 166, 36, 14);

    jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaVerde.png")));
    jPanel1.add(jLabel4);
    jLabel4.setBounds(38, 138, 36, 14);

    jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaVerde.png")));
    jPanel1.add(jLabel5);
    jLabel5.setBounds(38, 152, 36, 14);

    jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaVerde.png")));
    jPanel1.add(jLabel6);
    jLabel6.setBounds(38, 124, 36, 14);

    jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaVerde.png")));
    jPanel1.add(jLabel7);
    jLabel7.setBounds(38, 110, 36, 14);

    jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaVerde.png")));
    jPanel1.add(jLabel8);
    jLabel8.setBounds(38, 68, 36, 14);

    jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaVerde.png")));
    jPanel1.add(jLabel9);
    jLabel9.setBounds(38, 54, 36, 14);

    jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaVerde.png")));
    jPanel1.add(jLabel10);
    jLabel10.setBounds(38, 82, 36, 14);

    jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaVerde.png")));
    jPanel1.add(jLabel11);
    jLabel11.setBounds(38, 96, 36, 14);

    jLabel12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaAzzurro.png")));
    jPanel1.add(jLabel12);
    jLabel12.setBounds(77, 180, 36, 14);

    jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaAzzurro.png")));
    jPanel1.add(jLabel13);
    jLabel13.setBounds(77, 166, 36, 14);

    jLabel14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaAzzurro.png")));
    jPanel1.add(jLabel14);
    jLabel14.setBounds(77, 138, 36, 14);

    jLabel15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaAzzurro.png")));
    jPanel1.add(jLabel15);
    jLabel15.setBounds(77, 152, 36, 14);

    jLabel16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaAzzurro.png")));
    jPanel1.add(jLabel16);
    jLabel16.setBounds(77, 124, 36, 14);

    jLabel17.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaAzzurro.png")));
    jPanel1.add(jLabel17);
    jLabel17.setBounds(77, 110, 36, 14);

    jLabel18.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaAzzurro.png")));
    jPanel1.add(jLabel18);
    jLabel18.setBounds(77, 68, 36, 14);

    jLabel19.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaAzzurro.png")));
    jPanel1.add(jLabel19);
    jLabel19.setBounds(77, 54, 36, 14);

    jLabel20.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaAzzurro.png")));
    jPanel1.add(jLabel20);
    jLabel20.setBounds(77, 82, 36, 14);

    jLabel21.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaAzzurro.png")));
    jPanel1.add(jLabel21);
    jLabel21.setBounds(77, 96, 36, 14);

    jLabel22.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaBlu.png")));
    jPanel1.add(jLabel22);
    jLabel22.setBounds(116, 180, 36, 14);

    jLabel23.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaBlu.png")));
    jPanel1.add(jLabel23);
    jLabel23.setBounds(116, 166, 36, 14);

    jLabel24.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaBlu.png")));
    jPanel1.add(jLabel24);
    jLabel24.setBounds(116, 138, 36, 14);

    jLabel25.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaBlu.png")));
    jPanel1.add(jLabel25);
    jLabel25.setBounds(116, 152, 36, 14);

    jLabel26.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaBlu.png")));
    jPanel1.add(jLabel26);
    jLabel26.setBounds(116, 124, 36, 14);

    jLabel27.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaBlu.png")));
    jPanel1.add(jLabel27);
    jLabel27.setBounds(116, 110, 36, 14);

    jLabel28.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaBlu.png")));
    jPanel1.add(jLabel28);
    jLabel28.setBounds(116, 68, 36, 14);

    jLabel29.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaBlu.png")));
    jPanel1.add(jLabel29);
    jLabel29.setBounds(116, 54, 36, 14);

    jLabel30.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaBlu.png")));
    jPanel1.add(jLabel30);
    jLabel30.setBounds(116, 82, 36, 14);

    jLabel31.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaBlu.png")));
    jPanel1.add(jLabel31);
    jLabel31.setBounds(116, 96, 36, 14);

    jLabel32.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaRosso.png")));
    jPanel1.add(jLabel32);
    jLabel32.setBounds(155, 180, 36, 14);

    jLabel33.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaRosso.png")));
    jPanel1.add(jLabel33);
    jLabel33.setBounds(155, 166, 36, 14);

    jLabel34.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaRosso.png")));
    jPanel1.add(jLabel34);
    jLabel34.setBounds(155, 138, 36, 14);

    jLabel35.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaRosso.png")));
    jPanel1.add(jLabel35);
    jLabel35.setBounds(155, 152, 36, 14);

    jLabel36.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaRosso.png")));
    jPanel1.add(jLabel36);
    jLabel36.setBounds(155, 124, 36, 14);

    jLabel37.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaRosso.png")));
    jPanel1.add(jLabel37);
    jLabel37.setBounds(155, 110, 36, 14);

    jLabel38.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaRosso.png")));
    jPanel1.add(jLabel38);
    jLabel38.setBounds(155, 68, 36, 14);

    jLabel39.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaRosso.png")));
    jPanel1.add(jLabel39);
    jLabel39.setBounds(155, 54, 36, 14);

    jLabel40.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaRosso.png")));
    jPanel1.add(jLabel40);
    jLabel40.setBounds(155, 82, 36, 14);

    jLabel41.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Graficatore/UnitaRosso.png")));
    jPanel1.add(jLabel41);
    jLabel41.setBounds(155, 96, 36, 14);

    getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

    }//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;

    (HO OMESSO TUTTE LE ALTRE VARIABILI...)
    // End of variables declaration//GEN-END:variables
    }

    QUESTO E' IL FILE GRAPHER.HTML

    <HTML>
    <HEAD>
    <TITLE>Applet HTML Page</TITLE>
    </HEAD>
    <BODY>

    <H3><HR WIDTH="100%">Applet HTML Page<HR WIDTH="100%"></H3>




    <APPLET codebase="../" code="Graficatore/Grapher.class" width=251 height=231>
    <param name="fa1" value="2">
    <param name="fa2" value="5">
    <param name="fa3" value="10">
    <param name="fa4" value="8">
    </APPLET>
    </P>

    <HR WIDTH="100%"><FONT SIZE=-1>Generated by NetBeans IDE</FONT>
    </BODY>
    </HTML>

  6. #6
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    .java ???

    hai provato a compilare l'applet?

    ciao
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  7. #7
    CERTO!!!
    Ma che ti facevo vedere il file compilato??
    Che ci dovevi capire??

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 © 2025 vBulletin Solutions, Inc. All rights reserved.