mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
org.pushingpixels.substance.api.UiThreadingViolationException: Component creation must be done on Event Dispatch Thread
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12038 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
committed by
konstantin.zolotarev
parent
887ee46e08
commit
a6acdbaab2
@ -19,11 +19,13 @@
|
||||
*/
|
||||
package org.jivesoftware.spark.plugin.flashing;
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JComponent;
|
||||
|
||||
import org.jivesoftware.spark.preference.Preference;
|
||||
import org.jivesoftware.spark.util.log.Log;
|
||||
|
||||
public class FlashingPreference implements Preference {
|
||||
public static String NAMESPACE = "flashing";
|
||||
@ -32,7 +34,22 @@ public class FlashingPreference implements Preference {
|
||||
|
||||
public FlashingPreference() {
|
||||
preferences = new FlashingPreferences();
|
||||
|
||||
try {
|
||||
if (EventQueue.isDispatchThread()) {
|
||||
dialog = new FlashingPreferenceDialog();
|
||||
} else {
|
||||
EventQueue.invokeAndWait(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
dialog = new FlashingPreferenceDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
public FlashingPreferences getPreferences() {
|
||||
|
||||
Reference in New Issue
Block a user