• Post Reply Bookmark Topic Watch Topic
  • New Topic

GUI Won't Update Before Screenshot  RSS feed

 
Scott Florez
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi everyone. I have previously had hit-and-miss success with my postings on Sun's Java forums, so I thought I'd look for some help here. After altering my code many different ways as per suggestions received from those so-called experts, the above code is what I'm currently using to capture and save a screenshot. However, I have a small problem. The screenshot saved is not showing sig1, sig2, or sig3 and is still showing saveButton. Can anyone provide some suggestions? Thanks a lot!
[ December 05, 2006: Message edited by: Scott Florez ]
 
Tim LeMaster
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd use SwingWorker to run the screencapture and then used the finished method of it to change the visiblity back. This example seems to work well.



We are also so-called experts (though I suspect most people don't call themselves experts, myself included; we just try to help where possible) and its not very nice to go bad mouthing people behind their backs. The communities only work if people participate. Remember these so-called experts are helping you out of their time and for free. So I hope whether my code helps you or not, I don't see you bad mouthing javaranch's so-called experts somewhere else.
 
Scott Florez
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim, thanks a bunch for your help! It worked perfectly. I obviously hadn't used SwingWorker before, but with a quick search, I dug it up here: http://java.sun.com/products/jfc/tsc/articles/threads/src/SwingWorker.java

I implemented your code in a slightly different way, as I only wanted the current window captured instead of the whole screen. My implementation is below:



I don't mean to sound unappreciative about help from the other forum. I had just received many negative comments and criticisms that I wouldn't consider "constructive" on multiple occasions. I'm very happy to be a community member here now and hope to be able to help out whenever possible. Thanks so much everyone!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!