edt

Is there a good freeware clone of the VMS editor EDT for unix or the pc?

I would like to have the same editor available on all of the platforms I frequent. Emacs and Vi are not desired solutions. ...

Why EventDispatchThread in first place?

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 resource-consuming stuff to another threads. In Swing, on the other hand, you use EventQueue.invokeLater(Runnable) for UI and SwingWorker for background processing. No...

Active rendering and the EDT (Swing animation)

How should I run animation in a Swing applet? I have an animation thread performing active rendering and it initially animates fine. Sometimes (anywhere from 1 minute to 2 hours later) it begins to fail to update the screen and only the sounds occur. I believe this is due to the fact that the paint is not performed from the EDT causing ...

Passing variables to the Event Dispatch Thread

Hello, my GUI locks up because I need to update it through the EDT, however, I need to also pass a variable that is being updates with the GUI: while ((message = this.in.readLine()).startsWith("NUMPLAYERS")) { numOfPlayers = Integer.parseInt(message.split(":")[1]); numPlayers.setText("There are currently " + numOfPlayers + " pla...

Communication between the EDT and main threads in JAVA

Hello, I have been asking a lot of questions about a project I have been working on recently. Here is the scenario I am in and any help or point in the right direction would help a lot... This is a network program built with a server and multiple clients. Each client has a GUI which must act according to commands sent from the server. ...

Java Swing design pattern for complex class interaction

I'm developing a java swing application that will have several subsystems. For all intents and purposes, let's assume that I am making an internet chat program with a random additional piece of functionality. That functionality will be... a scheduler where you can set a time and get a reminder at that time, as well as notify everyone on ...

Howto manage the game state in face of the EDT?

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 uses Swing/Java2D as rendering. In the current development phase, no simulation and no AI is present and only the user is able to change the state of the game (for exampl...

Linux editor with VMS EDT like direction mode.

VMS editor EDT allows one to use the keypad to control most of ones editing commands. One of the rather nice features is that the direction of operation can be set to "up" or "down". This then effects commands like "move to next character" and "move to start of line". Another feature is that there are "character", "word" and "line" buffe...

Swing: Changing a label on hidden frame and then showing the frame happens in reverse order on EDT.

The Problem I create a dialog box in swing (JRE 6 update 10, Ubuntu linux). When the user has finished using the dialog box it is hidden. When the users click on a button in another frame, a label on the box is changed according to the button, and then the box is shown again. The problem I'm having is that the box is shown before the l...

Getting the value from a Swing component from outside the EDT

My current code looks like this: final String[] value = new String[1]; SwingUtilities.invokeAndWait(new Runnable() { public void run() { value[0] = textArea.getText(); } }); The use of a final array seems like a bit of a hack. Is there a more elegant solution? I've done a lot of searching, but I don't seem to be able...

Event Dispatch Thread meets the Java Memory Model

This is related to an earlier question I asked, where the answer was: If a field is accessed by multiple threads, it should be volatile or final, or accessed only with synchronized blocks. Otherwise, assigned values may not be visible to other threads. In addition anything that manipulates pixels on screen should be run f...

Is it possible to perform active rendering in Java Swing without being on the EDT?

I am looking into using Buffer Strategy and the following technique described on the Javadoc: // Main loop while (!done) { // Prepare for rendering the next frame // ... // Render single frame do { // The following loop ensures that the contents of the drawing buffer // are consistent in case the underlying surface was re...

How to wait for object creation in EDT without blocking EDT?

I am using an API in a Java library which is called from the event dispatch thread and requires me to return a fully-initialized UI component. It looks like this: public JDialog createDialog(); But I can only populate the dialog after loading from a database, which can take 10 seconds sometimes. Normally I would do that in a backgrou...

TreeSet acting weird

I'm having a weird problem with TreeSet (sortedNodes) and ArrayList (nodes). In my program, I have in a method called from Event Dispatch Thread (from ActionListener) these lines: System.out.println("nodes: "+nodes.size()); sortedNodes.addAll(nodes); System.out.println("sortedNodes: "+sortedNodes.size()); Probl...

Make process run on non EDT (event dispatch thread) thread from EDT

I have a method running on the EDT and within that I want to make it execute something on a new (non EDT) thread. My current code is follows: @Override public void actionPerformed(ActionEvent arg0) { //gathering parameters from GUI //below code I want to run in new Thread and then kill this thread/(close the JFrame) new GameInitial...

Java - AWT / Swing - handling the Event Dispatcher Thread

Hi, I have a question about the 'Event Descriptor Thread'. I have a Main class that is also a JFrame. It initialises the rest of the components in the code, some of them do not involve Swing and some of them do. Is it enough to simply initialise the Main class using the EDT like this?... public static void main(String[] args) { jav...

Trouble getting Swing to refresh JLabel (apparently on event dispatch thread)

I have this action listener: this.newGameButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent a) { MokkiGUI.this.game = newGameQuery(); MokkiGUI.this.AI = new AIPlayer(MokkiGUI.this.game.getBoard()); MokkiGUI.this.boardLabel.setText(""); MokkiGUI.this.boardLabel.repaint(); refresh...

Check if thread is EDT is necessary?

Hello, I have an UI implemented with Swing. One component does some work that may take some time, so I use SwingUtilities.invokeLater. However, I was reading some old code and found this in an ActionListener: if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(new Runnable() { public void run() { ...

Is it possible that EDT violations cause NullPointerException in an external software?

I have a Java software that was recently integrated into another Java software (which I will call "external" software). We use listeners and call back mechanisms for "communication" between two softwares. Creators of the "external" software say that they get a NullPointerException because of some EDT violations in my code. Can it be the...

Why a EDT violation happens?

I started to use CheckThreadViolationRepaintManager to detect EDT violations. It complains about: partner = getParameter("partner",generatePartnerSelectionPanel(),Design.partnerSelectionDuration); Because it does not like generatePartnerSelectionPanel() because it does not like JPanel panel = new JPanel(); in this method. But I cann...