DEV/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO1/Decapite.java
2024-03-09 14:19:25 +01:00

21 lines
776 B
Java

import java.awt.GraphicsEnvironment;
public class Decapite{
private boolean isHeadless;
private boolean isHeadlessInstance;
private GraphicsEnvironment environnementGraphique;
public Decapite(){
this.environnementGraphique = GraphicsEnvironment.getLocalGraphicsEnvironment();
this.isHeadless = environnementGraphique.isHeadless();
this.isHeadlessInstance = environnementGraphique.isHeadlessInstance();
}
@Override
public String toString(){
String isHeadlessString = this.isHeadless ? "oui" : "non";
String isHeadlessInstanceString = this.isHeadlessInstance ? "oui" : "non";
return "isHeadless dit : " + isHeadlessString + "\nisHeadlessInstance dit : " + isHeadlessInstanceString;
}
}