EDT « Development « Java Swing Q&A





1. Why EventDispatchThread in first place?    stackoverflow.com

This is the design decision I don't understand. Both Android and JME follow the policy that the thread that started an app is the UI thread and you take care to offload ...

2. Howto manage the game state in face of the EDT?    stackoverflow.com

I'm developing a real time strategy game clone on the Java platform and I have some conceptional questions about where to put and how to manage the game state. The game ...

3. Getting the value from a Swing component from outside the EDT    stackoverflow.com

My current code looks like this:

final String[] value = new String[1];

SwingUtilities.invokeAndWait(new Runnable() {
    public void run() {
        value[0] = textArea.getText();
  ...

4. Java Swing TanleModel fireTableRowsInserted on EDT    stackoverflow.com

I have a TableModel that is populated from a background running thread. I am calling fireTableRowsInserted when data is inserted, which is NOT on the EDT. My question is, do I ...

5. Java 1.5 Swing: what is the correct way to perform long-running operation outside the EDT?    stackoverflow.com

In a desktop Java 1.5 application (it has to run on a lot of MacOS X machines that will nerver see a 1.6 VM due to Apple politics) what is a ...

6. Does this code run on the EDT?    stackoverflow.com

given the following code:

public class MainFrame extends JFrame{

  public MainFrame() throws HeadlessException {
    super();
    this.setSize(500, 400);
    this.setVisible(true);
    this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);

 ...

7. What's the correct way to run a code in the EDT only once?    stackoverflow.com

I have a Swing application that uses a Java Thread to constantly perform some operation. The results of this operation update the contents of a graph in the UI:

class ExampleThread {
 ...

8. How to wait a result from the EDT?    stackoverflow.com

For test things, I want to launch a process on the swing edt, and wait for a result. Usualy, I do that with a invokeAndWait. But perhaps is it possible to use ...

9. How to Stop the Swing EDT    stackoverflow.com

The typical Swing application starts the EDT at the beginning and when the last window is closed the Application stops basically with a System.exit either implicit or explicit. But my little application ...





10. How do I profile the EDT in Java Swing?    stackoverflow.com

I have an application that I'm building in Swing. It has a scrollable and zoomable chart component which I can pan and zoom in. The whole thing is smooth ...

11. Demo from Sun doing GUI stuff outside the EDT?    stackoverflow.com

I am looking at SplashDemo.java from the Java Sun tutorials. The class illustrates how to create splash screens when an application starts up. SplashDemo creates a frame directly in the ...

12. [platform-dev] Swing EDT and NB    forums.netbeans.org

13. Does Swing component initialization have to occur on the EDT?    coderanch.com

For example: JTextField field = new JTextField(10); Must the initialization of a Swing component occur on the EDT or may the initialization occur on any thread? Obviously altering the components later needs to be on the EDT, showing a JFrame for example or changing the Border of a JComponent. I would have expected the initialization to be safe, but now that ...

14. What EXACTLY should be run in the EDT?    coderanch.com

15. I'm not sure if my refactoring is right on EDT issues.    coderanch.com

It's an applet. In the applet's start() method, create a login dialog, if the user fill the right password, build the main screen. The heavy task is login() . The original code like this: public void start() { super.start(); LOGO = loadImage( "Logo.gif" ); // Get the applet going & display the Login screen. try { ASwingWorker().startWorker(new Runnable() { public void ...

16. Cannot update GUI EDT issue    coderanch.com