Eai Galera estou usando FTP.... consigo listar os arquivos, gravar, pegar os docs do servidor FTP e passá-los para uma pasta....agora o problema é visualizar em um JFRAME.
setTitle("Visualizar Imagem");
label = new JLabel();
String path = "c:\fotos";
String namef = path+"teste.jpg";
ImageIcon img = new ImageIcon(namef);
label.setIcon( img );
add("Center", label );
setSize(img.getIconWidth(),img.getIconHeight());
Deste modo eu consigo mostrar uma imagem que esta na minha pasta fostos.......como seria setar uma pasta no ftp?
Estou tentando joga-la em um buffer e depois carrega-la....mas o setIcon só recebe ImageIcon
.............
String arquivo="foto.jpg";
Image img = null;
ftp.changeWorkingDirectory (pasta);
InputStream is = ftp.retrieveFileStream(arquivo);
//InputStream is = getClass().getResourceAsStream(arquivo);
BufferedInputStream bis = new BufferedInputStream(is);
byte[] bytes = new byte[10000];
int byteRead = bis.read(bytes,0,10000);
img = Toolkit.getDefaultToolkit().createImage(bytes,0,byteRead);
............
Alguem poderia me ajudar...VLW! :roll:
