Please!

o que esse codigo tem de errado?!

//: c12:IOStreamDemo.java
// Typical I/O stream configurations.
// {RunByHand}
// {Clean: IODemo.out,Data.txt,rtest.dat}
import com.bruceeckel.simpletest.;
import java.io.
;

public class IOStreamDemo {
private static Test monitor = new Test();
// Throw exceptions to console:
public static void main(String[] args)
throws IOException {
// 1. Reading input by lines:
BufferedReader in = new BufferedReader(
new FileReader(“IOStreamDemo.java”));
String s, s2 = new String();
while((s = in.readLine())!= null)
s2 += s + "
";
in.close();

// 4. File output
try {
  BufferedReader in4 = new BufferedReader(
    new StringReader(s2));
  PrintWriter out1 = new PrintWriter(
    new BufferedWriter(new FileWriter("IODemo.out")));
  int lineCount = 1;
  while((s = in4.readLine()) != null )
    out1.println(lineCount++ + ": " + s);
  out1.close();
} catch(EOFException e) {
  System.err.println("End of stream");
}

}

Tá dando pro aqui com esse codigo!!!
me ajudem…

“Tá dando problema” é uma descrição meio vaga, não? :slight_smile:

O que tá errado?

Cara, percebique você não tem muita experiência com java
recomendo você a dar uma estudada em coisas mais simples do que esta que você está querendo fazer…
tente começar do mais fácil e ir avançando, aí as dúvidas que você tiver agente pode tentar explicar e você vai entender melohr, porque o seu skill vai ser maior

Experiência, eu não tenho nenhuma mesmo!!!
Não sei fazer rodar nada no java…
esse programa está sendo desenvolvido no Jcreator, para um trabalho da Facu!!!
Tenho que falar sobre como posso criar um arquivo texto, ler, altera-lo…

[quote=“pir0”]o que esse codigo tem de errado?!
[/quote]

O que esta dando de erro para voce?

Rafael

Muito abrigado a todos os que me ajudaram.!!
já consegui resolver!!!

Valeu!!!
Té a proxima!!!

Muito Obrigado a todos que me ajudaram!!

Pessoal sou novato em java, to tentando ler o conteudo de um arquivo ZIP, com um html que passa como paramentro o nome do arquivo para um applet, funciona legal quando rodo direto (dando um duplo clique no arquivo html), mas quando chamo a página pelo inetmgr (IIS) ele não acha o arquivo ZIP, vejam o código …

</html

e o java

import java.applet.Applet;
import java.awt.Graphics;
import java.io.;
import java.net.
;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class HelloWorldApplet extends Applet
{
public void paint(Graphics g)
{
String sArquivo = “”;

 int j = 30;
 String NomeArquivo = "";
 String NomeArquivos = "";
 
 sArquivo = getParameter("Arquivo");
     g.drawString(sArquivo, 100, 25);

 
  //



  //
 try {
  String v = "";
  FileInputStream fis = new FileInputStream(sArquivo);        
  ZipInputStream zis = new ZipInputStream(fis);
  ZipEntry ze;
  while((ze=zis.getNextEntry())!=null){
        j=j+15;
        NomeArquivo = ze.getName();
      //  g.drawString(NomeArquivos, 100, j);
        int nPonto = NomeArquivo.indexOf(".");
        if (NomeArquivo.substring(nPonto).matches(".shp")){
             NomeArquivos = NomeArquivos + v + NomeArquivo;
             v = ",";
             g.drawString(NomeArquivos, 100, j);

                       }
    zis.closeEntry();
  }

  zis.close();
 // AbrePagina(NomeArquivos);

} catch (FileNotFoundException e) {
  e.printStackTrace();
}
catch (IOException e) {
  e.printStackTrace();
}


 }
 public void AbrePagina(String Arq)
{
  try {

      URL url = new URL("http://www.google.com.br?"+Arq);
      getAppletContext().showDocument(url, "_self");
      return;
      } catch (Exception e) {
      }
}

}

Posta o código com as tags [code] para facilitar…

[code]import java.applet.Applet;
import java.awt.Graphics;
import java.io.;
import java.net.
;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class HelloWorldApplet extends Applet
{
public void paint(Graphics g)
{
String sArquivo = “”;

 int j = 30;
 String NomeArquivo = "";
 String NomeArquivos = "";


 sArquivo = getParameter("Arquivo");
     g.drawString(sArquivo, 100, 25);



  //



  //
 try {
  String v = "";
  FileInputStream fis = new FileInputStream(sArquivo);
  ZipInputStream zis = new ZipInputStream(fis);
  ZipEntry ze;
  while((ze=zis.getNextEntry())!=null){
        j=j+15;
        NomeArquivo = ze.getName();
      //  g.drawString(NomeArquivos, 100, j);
        int nPonto = NomeArquivo.indexOf(".");
        if (NomeArquivo.substring(nPonto).matches(".shp")){
             NomeArquivos = NomeArquivos + v + NomeArquivo;
             v = ",";
             g.drawString(NomeArquivos, 100, j);

                       }
    zis.closeEntry();
  }

  zis.close();
 // AbrePagina(NomeArquivos);

} catch (FileNotFoundException e) {
  e.printStackTrace();
}
catch (IOException e) {
  e.printStackTrace();
}


 }
 public void AbrePagina(String Arq)
{
  try {

      URL url = new URL("http://www.google.com.br?"+Arq);
      getAppletContext().showDocument(url, "_self");
      return;
      } catch (Exception e) {
      }
}

}[/code]

<html>
<head></head>
<body>

<APPLET code="HelloWorldApplet.class" archive="HelloWorld.jar"
width="850" height="900">
<PARAM name="Arquivo"value="wgs.zip">
</body>
</html>
import java.applet.Applet;
import java.awt.Graphics;
import java.io.*;
import java.net.*;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

 public class HelloWorldApplet extends Applet
 {
     public void paint(Graphics g)
     {
     String sArquivo = "";

     int j = 30;
     String NomeArquivo = "";
     String NomeArquivos = "";


     sArquivo = getParameter("Arquivo");
         g.drawString(sArquivo, 100, 25);



      //



      //
     try {
      String v = "";
      FileInputStream fis = new FileInputStream(sArquivo);
      ZipInputStream zis = new ZipInputStream(fis);
      ZipEntry ze;
      while((ze=zis.getNextEntry())!=null){
            j=j+15;
            NomeArquivo = ze.getName();
          //  g.drawString(NomeArquivos, 100, j);
            int nPonto = NomeArquivo.indexOf(".");
            if (NomeArquivo.substring(nPonto).matches(".shp")){
                 NomeArquivos = NomeArquivos + v + NomeArquivo;
                 v = ",";
                 g.drawString(NomeArquivos, 100, j);

                           }
        zis.closeEntry();
      }

      zis.close();
     // AbrePagina(NomeArquivos);

    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    catch (IOException e) {
      e.printStackTrace();
    }


     }
     public void AbrePagina(String Arq)
    {
      try {

          URL url = new URL("http://www.google.com.br?"+Arq);
          getAppletContext().showDocument(url, "_self");
          return;
          } catch (Exception e) {
          }
    }
}
<html>
<head></head>
<body>

<APPLET code="HelloWorldApplet.class" archive="HelloWorld.jar"
width="850" height="900">
<PARAM name="Arquivo"value="wgs.zip">
</body>
</html>