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

    dove sbaglio?

    ragazzi scusate sono nuovissimo di java e so pochissimo oggi mi sono cimentato su un progetto che deve uplodare dei file su ftp ma mi dite dove sbaglio??

    codice:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    
    /*
     * NumberAdditionUI.java
     *
     * Created on 29-gen-2009, 16.39.39
     */
    
    package my.numeraddition;
    
    /**
     *
     * @author corradocacciapuoti
     */
    public class NumberAdditionUI extends javax.swing.JFrame {
    
        /** Creates new form NumberAdditionUI */
        public NumberAdditionUI() {
            initComponents();
        }
    
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
        private void initComponents() {
    
            jTabbedPane1 = new javax.swing.JTabbedPane();
            jButton3 = new javax.swing.JButton();
    
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    
            jButton3.setText("Upload");
            jButton3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton3ActionPerformed(evt);
                }
            });
    
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(136, Short.MAX_VALUE)
                    .add(jButton3)
                    .add(143, 143, 143))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(120, Short.MAX_VALUE)
                    .add(jButton3)
                    .add(112, 112, 112))
            );
    
            pack();
        }// </editor-fold>                        
    
        private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                         
    FTPClient ftpClient = new FTPClient();
    ftpClient.connect("ftp.foo.com", "user01", "pass1234");
    ftpClient.download("C:\\Temp\\", "README.txt");
    // Eventually other operations here ...
    ftpClient.disconnect();
        }                                        
    
        /**
        * @param args the command line arguments
        */
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NumberAdditionUI().setVisible(true);
                }
            });
        }
    
        // Variables declaration - do not modify                     
        private javax.swing.JButton jButton3;
        private javax.swing.JTabbedPane jTabbedPane1;
        // End of variables declaration                   
    
    }
    uso netbeans su mac

    ed ecco la schermata con gli errori:



  2. #2
    Evidentemente non hai le librerie usate
    http://www.anobii.com/isalreadyinuse

  3. #3
    il problema è che anche se sostituisco le stringhe con questo
    codice:
    JOptionPane.showMessageDialog(frame, "Eggs are not supposed to be green.");
    e compilo mi da build failed con il punto esclamativo nel triangolino giallo affianco alla stringa con scritto

    Cannot find symbol
    symbol: variable JOptionPane
    location: class my.numeraddition.NumberAdditionUI

  4. #4
    Utente di HTML.it L'avatar di Pastore12
    Registrato dal
    Oct 2008
    Messaggi
    1,051
    Originariamente inviato da isAlreadyInUse
    Evidentemente non hai le librerie usate
    Direi che ha ragione lui...

    JOptionPane fa parte di swing, quindi devi importare questa libreria! E poi ce ne saranno delle altre... con un uso sapiente delle API e di google ne verrai a capo.
    "Ethics are to me something private. Whenever you use it as an argument for why somebody_else should do something, you’re no longer being ethical, you’re just being a sanctimonious dick-head"
    Linus Torvalds

  5. #5
    Moderatore di Programmazione L'avatar di LeleFT
    Registrato dal
    Jun 2003
    Messaggi
    17,328

    Moderazione

    Magari leggere anche il regolamento sulle modalità di scelta del titolo...


    Ciao.
    "Perchè spendere anche solo 5 dollari per un S.O., quando posso averne uno gratis e spendere quei 5 dollari per 5 bottiglie di birra?" [Jon "maddog" Hall]
    Fatti non foste a viver come bruti, ma per seguir virtute e canoscenza

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.