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??
uso netbeans su maccodice:/* * 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 }
ed ecco la schermata con gli errori:
![]()

Rispondi quotando

