2024-03-09 12:31:18 +01:00
|
|
|
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";
|
|
|
|
|
2024-03-09 14:19:25 +01:00
|
|
|
return "isHeadless dit : " + isHeadlessString + "\nisHeadlessInstance dit : " + isHeadlessInstanceString;
|
2024-03-09 12:31:18 +01:00
|
|
|
}
|
|
|
|
}
|