I'm tired, so pheraps the solution is simple but...
I've used the tutorial on FAQ to make screenshot of a canvas3d. It works but it seems that it's scheduled only when mine methods are not running.
So, if i write:
// called when i press a swing button
private void pressButtonActionPerformed(java.awt.event.ActionEvent evt) { MyCanvas3D.fileName = "C:/test.jpg"; MyCanvas3D.writeJPEG_ = true; MyCanvas3D.repaint();
workArea.removeAll(); contextual.removeAll();
workArea.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
try { EstimateGui estimate =new EstimateGui(this); workArea.add(estimate); } catch (Exception e) {
IvyLog.write("MainGui","preventivoButtonActionPerformed",e,java.util.ResourceBundle.getBundle("language/alertLanguage").getString("error"),this); }
workArea.updateUI(); contextual.updateUI(); }
the canvas3d will be no repainted until the end of "pressButtonActionPerformed", but inside it there are the commands to remove the canvas3d and to insert a new jPanel in the same place. Result: no screenshot saved.
I've tried to wait some milliseconds, but the result is the same: until i'm inside pressButtonActionPerformed, no jpg is saved.
How can i do it? I've to simulate these operations:
1) catch the pressed button 2) save a screenshot of the canvas3d 3) remove the jpanel and insert a new one.
Thanks
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".