Please refrain from top-posting, I find it most confusing
<http://www.physci.org/codes/javafaq.jsp#netiquette>
See further comments below.
> "Liz" <hilizbabe@yahoo.com> escribió en el mensaje
>> You can use QuickTable to implement the same feature in just three
>> statements
>>
>> DBTable myFileTable = new DBTable();
>> File f = new File("C:\\temp\\");
>> myFileTable.refreshDataObjects(f.listFiles(), null);
> Yes, but the problem is the same because "C:\\temp\\" must be variable, is
> not constant,
Well ..duhh. (We are all programmers here!)
>..so when I select the directory from the JFileChooser it give
> in this way "C:\temp\", at least using my code.
Try this..
String s = "c:\temp";
System.out.println(s);
s = "c:\\temp";
System.out.println(s);
BTW - beginner questions are best asked on
<http://www.physci.org/codes/javafaq.jsp#cljh>

Signature
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
Mr Bender's Wardrobe By ROBOTANY 500
Davisote - 01 Aug 2005 12:41 GMT
> Please refrain from top-posting, I find it most confusing
> <http://www.physci.org/codes/javafaq.jsp#netiquette>
[quoted text clipped - 26 lines]
> BTW - beginner questions are best asked on
> <http://www.physci.org/codes/javafaq.jsp#cljh>
oK, RIGHT
THEN, why this doesn't work??
(dirLocal is a JLabel)
void btnSeleccionaDirectorio_actionPerformed(ActionEvent e) {
int retval;
JFileChooser chooser = new JFileChooser();
//chooser.DIRECTORIES_ONLY;
chooser.setDialogType(JFileChooser.OPEN_DIALOG);
chooser.setDialogTitle("Select directory??");
chooser.setMultiSelectionEnabled(false);
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
if (chooser.showDialog(this, "Select") !=
JFileChooser.APPROVE_OPTION) {
System.exit(1);
}
dirLocal.setText("Local Directory: " +
chooser.getSelectedFile().getAbsolutePath());
model.setColumnCount(0);
model.setRowCount(0);
int columns = 2;
model.addColumn("Fichero");
model.addColumn("Estado");
loadTable(dirLocal.getText());
}
void loadTable(String dirLocal) {
File myFile = new File(dirLocal);
File[] allFiles = myFile.listFiles();
int i, j, k;
System.out.println("Directory: " + dirLocal);
k = 0;
for (i = 0; i < allFiles.length; i++) {
if (allFiles[i].isFile()) {
j = (new Long(allFiles[i].length())).intValue();
if (j <= MAX_TAM) {
Vector row = new Vector(2);
row.addElement(allFiles[i]);
row.addElement(new Integer(3));
model.insertRow(k++, row);
}
}
}
Greetings
Andrew Thompson - 01 Aug 2005 15:08 GMT
> THEN, why this doesn't work??
(shrugs) Maybe it is just lazy.
It does not compile for me.

Signature
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
LOADING....
Davisote - 02 Aug 2005 10:11 GMT
>>THEN, why this doesn't work??
>
> (shrugs) Maybe it is just lazy.
>
> It does not compile for me.
thanks for nothing
Aki Laukkanen - 02 Aug 2005 10:23 GMT
>>> THEN, why this doesn't work??
>>
[quoted text clipped - 3 lines]
>>
> thanks for nothing
What Andrew was trying to tell you is:
"Look at some of the error messages given by your compiler and figure it
out from there."
The compiler is even kind enough to tell you what type of error[s] you
made and approximately where on which line they are.
HTH.

Signature
-Aki "Sus" Laukkanen
Davisote - 02 Aug 2005 12:14 GMT
>>>> THEN, why this doesn't work??
>>>
[quoted text clipped - 10 lines]
> made and approximately where on which line they are.
> HTH.
Hi.
There is only one error because my var is "c:\temp" and the vector
created is null son allFiles.length give me an exception, BUT if I put
"C:\\temp" it create the vector with the files correctly.
So. Only I want the way to obtain an absolute path in the form "C:\\temp".
anyway, thanks for your reply