gente… meu codigo ta assim…
package droplist;
public class Main {
public static void main(String[] args){
Fonte F = new Fonte();
F.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
F.setVisible(true);
F.setResizable(false);
F.setSize(300, 400);
}
}
segundo arquivo:
package droplist;
public class Fonte extends JFrame{
private String[] Mdrops;
public Fonte() throws FileNotFoundException, IOException{
File db = new File("c:\Pastinha\Data\Mdps.dat");
FileReader arquivoMdps = new FileReader(db);//diretorio do Mdps.dat
BufferedReader buffRead = new BufferedReader(arquivoMdps);
String temp;
if(db.exists()){
try{
while ((temp = buffRead.readLine()) != null) {
for(int i=0; i<buffRead.readLine().length(); i++){
Mdrops[i] = temp;
}
}
}catch(FileNotFoundException iOe){
JOptionPane.showMessageDialog(null, "Arquivo Mdps não encontrado");
}
}
}
}
olhem o erro que está dando:
init:
deps-jar:
Compiling 2 source files to C:\projeto alpha\RB Evo DropList\build\classes
C:\projeto alpha\RB Evo DropList\src\rbevodroplist\Main.java:21: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
Fonte F = new Fonte();
1 error
BUILD FAILED (total time: 0 seconds)
o que está errado?
eu errei em algum lugar!? Não entendo. Deveria estár certo… mas não está.
