Java 25 I can’t edit my comments anymore.
Hello.
For a few days now, my comments are being rejected.
What I’m doing:
System.out.println(" name "+name);
Image im=createImage(500,700);
int imagew=im.getWidth(this);
int imageh=im.getHeight(this);
System.out.println(" imagew "+imagew+" imageh "+imageh);
gTTampon=im.getGraphics();
im=Toolkit.getDefaultToolkit().getImage(name);
System.out.println(" im "+im);
imagew=im.getWidth(this);
imageh=im.getHeight(this);
System.out.println(" **imagew "+imagew+" imageh "+imageh);
and here is the result:
name c:/Users/MASTER/Java/jk17/en_francais/application_puits_mar_2025/appli_puits_etats 2 et 3 dimensions.jpg image_comm sun.awt.image.ToolkitImage@436a4e4b
imagew 500 imageh 700
im sun.awt.image.ToolkitImage@436a4e4b
**imagew -1 imageh -1
In summary: the name is initially correct, the image creation is also correct (with the width and height reported). The image "im" also seems correct.
What’s odd is what comes out after the "toolkit" instruction: the widths and heights, which were correct before this instruction, become -1. In fact the "toolkit" instruction has set the width and height values to -1 to indicate there was a problem; which one????
The rest is obvious: I cannot display the comment included in "name". This has been going on for several days and I’m trying to figure out!
Thanks in advance for your help.
Benoît Delcourt.