33 lines
782 B
Java
33 lines
782 B
Java
![]() |
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");
|
||
|
}
|
||
|
}
|
||
|
}
|