Benützer:


Ausführung

Storyboard

>Modell

ID:(109, 0)



Dateien Lesen

Beschreibung

ID:(1272, 0)



Bibliothek für Dateiverwaltung

Beschreibung

ID:(2452, 0)



JFileChooser

Beschreibung

ID:(1275, 0)



Öffnen der Datei

Beschreibung

ID:(1257, 0)



Auslegen der Linie

Beschreibung

ID:(1258, 0)



Ejemplo de uso de JFileChooser

Beschreibung

Un ejemplo que emplea JFileChooser para seleccionar un archivo es ``` package chooser; import java.io.File; import javax.swing.JFileChooser; import javax.swing.JFrame; public class SampleJFileChooser { public SampleJFileChooser(){ JFileChooser jFileChooser = new JFileChooser(); jFileChooser.setCurrentDirectory(new File("/User/alvinreyes")); int result = jFileChooser.showOpenDialog(new JFrame()); if (result == JFileChooser.APPROVE_OPTION) { File selectedFile = jFileChooser.getSelectedFile(); System.out.println("Selected file: " + selectedFile.getAbsolutePath()); } } public static void main(String[] args) { new SampleJFileChooser(); } } ```

ID:(8863, 0)



Ejemplo de Lectura y Escritura

Beschreibung

La siguiente rutina lee un archivo y graba su contenido en un segundo archivo: ``` import java.io.*; public class CopyFile { public static void main(String args[]) throws IOException { FileInputStream in = null; FileOutputStream out = null; try { in = new FileInputStream("input.txt"); out = new FileOutputStream("output.txt"); int c; while ((c = in.read()) != -1) { out.write(c); } }finally { if (in != null) { in.close(); } if (out != null) { out.close(); } } } } ```

ID:(8864, 0)



XML DOM

Beschreibung

ID:(1273, 0)