equal
deleted
inserted
replaced
8 |
8 |
9 import javax.swing.SwingUtilities |
9 import javax.swing.SwingUtilities |
10 |
10 |
11 object Swing |
11 object Swing |
12 { |
12 { |
13 def now(body: => Unit) = |
13 def now(body: => Unit) { |
14 SwingUtilities.invokeAndWait(new Runnable { def run = body }) |
14 if (SwingUtilities.isEventDispatchThread) body |
|
15 else SwingUtilities.invokeAndWait(new Runnable { def run = body }) |
|
16 } |
15 |
17 |
16 def later(body: => Unit) = |
18 def later(body: => Unit) { |
17 SwingUtilities.invokeLater(new Runnable { def run = body }) |
19 if (SwingUtilities.isEventDispatchThread) body |
|
20 else SwingUtilities.invokeLater(new Runnable { def run = body }) |
|
21 } |
18 } |
22 } |