Skip to main content
deleted 238 characters in body
Source Link
Jonathan Holloway
  • 64k
  • 33
  • 128
  • 152

There are two approaches to take in order to avoid blocking GUI updates.

a) SwingUtilities.invokeLater() which you then need to wrap in a thread itself...

http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater

b)You can use SwingWorker which is available in Java 6. If you need to use it in a previous version of Java you can always use:

https://swingworker.dev.java.net/

SwingWorker is probably the cleaner approach. You can find more info about it here:

http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

You can then write a new ServerSwingWorker inner class to wrap that functionality or use an anonymous inner class.

There are two approaches to take in order to avoid blocking GUI updates.

a) SwingUtilities.invokeLater() which you then need to wrap in a thread itself...

http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater

b) SwingWorker which is available in Java 6. If you need to use it in a previous version of Java you can always use:

https://swingworker.dev.java.net/

SwingWorker is probably the cleaner approach. You can find more info about it here:

http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

You can then write a new ServerSwingWorker inner class to wrap that functionality or use an anonymous inner class.

You can use SwingWorker which is available in Java 6. If you need to use it in a previous version of Java you can always use:

https://swingworker.dev.java.net/

SwingWorker is probably the cleaner approach. You can find more info about it here:

http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

You can then write a new ServerSwingWorker inner class to wrap that functionality or use an anonymous inner class.

edited body
Source Link
Jonathan Holloway
  • 64k
  • 33
  • 128
  • 152

There are two approaches to take in order to avoid blocking GUI updates.

  1. SwingUtilities.invokeLater() which you then need to wrap in a thread itself...

a) SwingUtilities.invokeLater() which you then need to wrap in a thread itself...

http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater(java.lang.Runnable)http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater

  1. SwingWorker which is available in Java 6. If you need to use it in a previous version of Java you can always use:

b) SwingWorker which is available in Java 6. If you need to use it in a previous version of Java you can always use:

https://swingworker.dev.java.net/

SwingWorker is probably the cleaner approach. You can find more info about it here:

http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

You can then write a new ServerSwingWorker inner class to wrap that functionality or use an anonymous inner class.

There are two approaches to take in order to avoid blocking GUI updates.

  1. SwingUtilities.invokeLater() which you then need to wrap in a thread itself...

http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater(java.lang.Runnable)

  1. SwingWorker which is available in Java 6. If you need to use it in a previous version of Java you can always use:

https://swingworker.dev.java.net/

SwingWorker is probably the cleaner approach. You can find more info about it here:

http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

You can then write a new ServerSwingWorker inner class to wrap that functionality or use an anonymous inner class.

There are two approaches to take in order to avoid blocking GUI updates.

a) SwingUtilities.invokeLater() which you then need to wrap in a thread itself...

http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater

b) SwingWorker which is available in Java 6. If you need to use it in a previous version of Java you can always use:

https://swingworker.dev.java.net/

SwingWorker is probably the cleaner approach. You can find more info about it here:

http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

You can then write a new ServerSwingWorker inner class to wrap that functionality or use an anonymous inner class.

Source Link
Jonathan Holloway
  • 64k
  • 33
  • 128
  • 152

There are two approaches to take in order to avoid blocking GUI updates.

  1. SwingUtilities.invokeLater() which you then need to wrap in a thread itself...

http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater(java.lang.Runnable)

  1. SwingWorker which is available in Java 6. If you need to use it in a previous version of Java you can always use:

https://swingworker.dev.java.net/

SwingWorker is probably the cleaner approach. You can find more info about it here:

http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

You can then write a new ServerSwingWorker inner class to wrap that functionality or use an anonymous inner class.