Hello,
I want to write a application, which reads the data of the CD-Rom.
Today many computers have more than one CD-Rom.
I want to use a combobox where the user can select the right CD-ROM. I don't want to show the drives which aren't a CD-Rom.
In the File-Class I found a Method to extract all drives from system. This method is called listRoots(). The method copies all drives in an array of File-Class.
I have the problem that everytime I use a method of the File-Class, on the index in the array of listRoots(), which points to the floppy-disk-drive, I get a messagebox, that the drive can't be read. This is no exception because in a universal try-block, the debugger don't jump in the case-block.
Is there any way to suppress this messagebox?
Here a code-example:
try{
for (int i=0; i<myFileroots.length;i++){
if (myFileroots.canWrite()==true)
System.out.print(myFileroots.toString());
}
}
catch(Exception e){
System.out.print(e.getMessage());
}
My floppy-disk-drive is on index 0. So the first time, the if-clause is called, the messasgebox appears.
In reguards
Kostarsus
I want to write a application, which reads the data of the CD-Rom.
Today many computers have more than one CD-Rom.
I want to use a combobox where the user can select the right CD-ROM. I don't want to show the drives which aren't a CD-Rom.
In the File-Class I found a Method to extract all drives from system. This method is called listRoots(). The method copies all drives in an array of File-Class.
I have the problem that everytime I use a method of the File-Class, on the index in the array of listRoots(), which points to the floppy-disk-drive, I get a messagebox, that the drive can't be read. This is no exception because in a universal try-block, the debugger don't jump in the case-block.
Is there any way to suppress this messagebox?
Here a code-example:
try{
for (int i=0; i<myFileroots.length;i++){
if (myFileroots.canWrite()==true)
System.out.print(myFileroots.toString());
}
}
catch(Exception e){
System.out.print(e.getMessage());
}
My floppy-disk-drive is on index 0. So the first time, the if-clause is called, the messasgebox appears.
In reguards
Kostarsus