title: Problems in running I/O in EDT of applet
body: <p>Our applet source code is kind of spaghetti (written in 2000, Java 1.3 then) and we want to recompile it to Java 1.6 or 1.7.</p>
  
  <p>When I'm testing it, most of the Swing is OK but after sometime, an <code>Exception</code> occurred, which is EDT exception.  Specifically, when a drag event is done, a series of EDT exceptions appear.</p>
  
  <p>Is this something to with coding the I/O part in <code>ActionListeners</code> because I've read that it is bad to code I/O operations in action listeners, which EDT executes when a action is performed.</p>
  
  <p>EDIT:</p>
  
  <p>This is the recurring exception</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-3" java.lang.NullPointerException
      at javax.swing.BufferStrategyPaintManager.flushAccumulatedRegion(Unknown Source)
      at javax.swing.BufferStrategyPaintManager.copyArea(Unknown Source)
      at javax.swing.RepaintManager.copyArea(Unknown Source)
      at javax.swing.JViewport.blitDoubleBuffered(Unknown Source)
      at javax.swing.JViewport.windowBlitPaint(Unknown Source)
      at javax.swing.JViewport.setViewPosition(Unknown Source)
      at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.vsbStateChanged(Unknown Source)
      at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.stateChanged(Unknown Source)
      at javax.swing.DefaultBoundedRangeModel.fireStateChanged(Unknown Source)
      at javax.swing.DefaultBoundedRangeModel.setRangeProperties(Unknown Source)
      at javax.swing.DefaultBoundedRangeModel.setValue(Unknown Source)
      at javax.swing.JScrollBar.setValue(Unknown Source)
      at javax.swing.plaf.basic.BasicScrollBarUI$TrackListener.setValueFrom(Unknown Source)
      at javax.swing.plaf.basic.BasicScrollBarUI$TrackListener.mouseDragged(Unknown Source)
      at java.awt.Component.processMouseMotionEvent(Unknown Source)
      at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
      at java.awt.Component.processEvent(Unknown Source)
      at java.awt.Container.processEvent(Unknown Source)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
      at java.awt.EventQueue.access$000(Unknown Source)
      at java.awt.EventQueue$1.run(Unknown Source)
      at java.awt.EventQueue$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
      at java.awt.EventQueue$2.run(Unknown Source)
      at java.awt.EventQueue$2.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)
  </code></pre>