code_junkie

java.awt.HeadlessException - Applet not displayed - Part 2

Nov 14th, 2011
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. try {
  2.  
  3. //Code that throws headless exception
  4.  
  5. } catch (HeadlessException e) {
  6.  
  7. printStacktrace(); //basically do nothing
  8. }
  9.  
  10. if (! java.awt.GraphicsEnvironment.isHeadless()) {
  11. // code that throws headless exception
  12. } else {
  13. log.info("Skipping GUI portion")
  14. }
Add Comment
Please, Sign In to add comment