Files
SAE32_2022/src/Graphics/GraphicFile.java

33 lines
782 B
Java
Raw Normal View History

2023-01-05 03:22:24 +01:00
package Graphics;
import java.io.InputStream;
import java.io.IOException;
import javax.swing.JPanel;
import java.awt.GridLayout;
import java.net.URL;
public class GraphicFile extends JPanel {
public GraphicFile(URL url) {
super();
try {
System.out.println("[+] Lecture de " + url);
this.setLayout(new GridLayout(100, 1));
InputStream jsonReader = url.openStream();
// ICI le code
jsonReader.close();
} catch (IOException e) {
System.out.println("[!] Fichier " + url.getFile() + " n'existe pas");
}
}
public void addIndentation(StringBuilder sb, int indentLevel) {
for (int i = 0; i < indentLevel; i++) {
sb.append("\t");
}
}
}