Event « Thread « Java Swing Q&A





1. Can there be more than one AWT event queue?    stackoverflow.com

I've got a thread dump of an applet running on JVM 1.6.0_12 in Opera 9.64 Build 10487 - and it shows three event queues! As far as I know the Java ...

2. What is the recommended way for SWT Views (ViewPart) which receive a external event to update a GUI element?    stackoverflow.com

My View is derived from ViewPart, but I have a listener on it which receives Events from non-GUI threads. If something is supposed to happen on within the GUI thread, it ...

3. Confusing Event Order in Java Swing Thread    stackoverflow.com

i've panel which contains a text field for entering number and a submit button sometimes new (updated) value can not be sent when i click the button (the previous value of the ...

4. Java Swing Multiple Event Listeners for a Single Event Source in a single-threaded environment    stackoverflow.com

I am currently learning Swing, and I am new to GUI development in general. In my test application, I have multiple event listners for a single event source, and I am ...

5. Should I be using a Java "worker thread" for this CPU simulation app?    stackoverflow.com

I'm writing an emulator of an old computer in Java/Swing, and I think I've identified the design problem that I'm having. As idiosyncratic as this application is, I suspect someone ...

6. Question Regarding Use of Thread Count in Java GUI    stackoverflow.com

So in this section of code I have, I want to essentially tell the GUI to disable the button and bring up a pop-up window when no threads are running anymore ...

7. KeyEventDispatcher works in one application, but not another    stackoverflow.com

I have on one hand a complex, multi-threaded application, and on the other a single threaded test application that I was hoping to use to debug the first one. I ...

8. AWT event thread interruption    stackoverflow.com

I have code:

import java.awt.Dimension;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;


public class Test2 {

JFrame frame = null;
JPanel panel = null;
JButton button = null;
Task task = null;
Indicator indicator = null;
Runnable computation;

public static void ...

9. Is a swingWorker guaranteed to throw a state property change event on completion?    stackoverflow.com

I have a class that takes in a number of SwingWorkers and runs them one at a time in a certain order. I use a ReentrantLock to make sure that only ...





10. Forcing Java to refresh the Java Swing GUI    stackoverflow.com

Ive coded two Computers to play each other in Reversi, however when they play each other. The board only updates after the game has finished. From some googling around I know ...

11. ActionListener error when passing arrays as arguments for thread safety    stackoverflow.com

I am re-writing some code to improve thread safety. I am trying to pass arrays as arguments rather than storing them in class variables. But an error is being ...

12. Multithreading for Event Handling    coderanch.com

13. Thread in actionPerformed...    coderanch.com

I have created, my First, Swing/AWT application. It does a search through jar and zip files looking for a class. My problem is this. I am passing a reference to two textareas to the search class. The search class is updating the left and right textarea's but they are not being refreshed until the entire search has completed. I think this ...

14. AWT/Swing Event Threads vs SWT - Rob?    coderanch.com

In SWT, only the UI thread (the one that created the Display object) can update any UI elements. You can spawn worker threads that chug away, and remain blissfully ignorant of SWT threading rules--as long as you don't have to update the UI. To update the UI, you use Display.asyncExec() or Display.syncExec(). These methods actually block UI updates, so in practice ...

15. RuntimeExceptions in event thread    coderanch.com

Hi, Originally posted by Kevin Stembridge: For example, when a RuntimeException is being thrown from within an actionPerformed method, the GUI shows no effect but the stack trace is printed to System.err. I would expect that your application will have 'frozen' or can't repaint itself anymore when this happens. If your AWT thread dies, then it's bad news for your application. ...

16. Simple Swing question about event handling threads    coderanch.com

I think I understand this but I'd like to make sure. The book I'm currently working with is talking about event handles in the run-time library thread and I made a little test app to show teach myself about event handlers and exactly what mouse/key window events will cause what interface required methods to be handled in what way. package com.tristanjcrouse.archive; ...





18. Threads and mouse events    coderanch.com

So, I know this doesn't work, but what I want to do seems to be what would intuitively seem to happen if you set a boolean variable "waiting" to true in the code for one button's event handler on a panel, then followed that (still in the event handling code) with while (waiting) {}; and in a separate, unrelated, mouseInputAdapter's handling ...

19. Using a seperate Swing event thread    forums.oracle.com

A window I am writing is part of a much larger application. I believe this application does a lot of work on the Swing event thread. Due to the nature of the application, my new window should remain fully functional at all times, even while the main window is busy working a task. Currently, while a task is running on the ...

20. Swing - event thread - other threads    forums.oracle.com

"Daemon threads are service providers for other threads running in the same process as the daemon thread. For example, the HotJava browser uses up to four daemon threads named "Image Fetcher" to fetch images from the file system or network for any thread that needs one. The run() method for a daemon thread is typically an infinite loop that waits for ...