Questions tagged [edt]

For questions about edt, a line/screen editor, found on vax/vms systems. The Event Dispatch Thread in Java Swing applications is also abbreviated EDT. The tag [event-dispatch-thread] is used for that.

A line/screen editor, found on vax/vms systems.

The Event Dispatch Thread in Java Swing applications is also abbreviated EDT. The tag is used for that.

52 questions
16
votes
2 answers

How does the scipy distance_transform_edt function work?

https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.ndimage.morphology.distance_transform_edt.html I'm having trouble understanding how the Euclidean distance transform function works in Scipy. From what I understand, it is different…
user135237
  • 389
  • 1
  • 3
  • 12
5
votes
1 answer

Why should SwingUtils.invokeAndWait() method be called outside an EDT thread?

Edit : I have referred this link and I'm able to understand the codeflow of InvokeLater. My question is, why is this logic implemented this way? Are there any specific reasons? Following is my code: private void init() { JFrame jfr = new…
Diya
  • 127
  • 1
  • 9
3
votes
1 answer

Java, jframe resizing while dragging issue

I would like my jframe to change its size and contents depending on the x coordinate. Initially the jframe appears in the 'primary zone' (x <= 1400) witn a panel sized 500x500 added to the jframe's content pane. Desired: When it is dragged and…
3
votes
2 answers

In Swing can you post an event to the top of the EDT events queue?

I am looking for a way to do what the InvokeLater() function does only instead of putting the event on the bottom of the event queue it puts it on top. At least I think that will do what I want, maybe there's a better way. Below describes what I'm…
mretondo
  • 31
  • 2
3
votes
2 answers

SwingUtilities InvokeLater- what is considered bad practice?

I've got a question about what would be the correct practice to use the invokeLater method of SwingUtilities. So to begin, I'd like to confirm that I am understanding it correctly. From what I understand, changes to the GUI must be done on the EDT,…
DBS
  • 63
  • 3
3
votes
1 answer

Java - SwingWorker - problem in process() method

I am using javax.swing.SwingWorker for the first time. I want to update a JLabel from the interim results published by the swing worker as follows: publish("Published String"); Now to update the JLabel, I have coded the…
Amit
  • 33,847
  • 91
  • 226
  • 299
2
votes
4 answers

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…
Jack
2
votes
2 answers

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…
Pool
  • 11,999
  • 14
  • 68
  • 78
2
votes
2 answers

Make the animation faster when there are thousands of components

I am trying to hide a JSplitPane with animation. By hide, I mean to setDividerLocation(0) so its left component is invisible (technically it is visible, but with zero width): public class SplitPaneTest { public static void main(String[] args)…
George Z.
  • 6,643
  • 4
  • 27
  • 47
2
votes
1 answer

Non Sloppy design patterns for updating GUI from a different thread in Java

What design pattern is best for updating the GUI when dealing with other threads in Java (Swing)? For example, imagine an Object (like a custom JPanel) that has a JList that has a DefaultListModel supporting it. A threading listening on a Socket can…
Matthew
  • 3,886
  • 7
  • 47
  • 84
2
votes
5 answers

Swing thread safety boilerplate

For the sake of simplicity, imagine an application that downloads a file. There is a simple GUI with one label that displays progress. To avoid EDT violations, like every lawful citizen I download the file in one thread (main), and update GUI in…
Konrad Garus
  • 53,145
  • 43
  • 157
  • 230
2
votes
4 answers

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…
Roman
  • 124,451
  • 167
  • 349
  • 456
2
votes
4 answers

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 …
Pool
  • 11,999
  • 14
  • 68
  • 78
1
vote
0 answers

Enclosing instance of type GUI stops EDT

I am currently making an Algorithm Visualizer and I am trying to put all the other algorithms in a different class. I was getting this error No enclosing instance of type GUI is accessible. So I added gui in the line (in the Algorithms…
Anon214
  • 68
  • 5
1
vote
4 answers

Best way to remove 'EDT' from a date returned via javascript with toLocaleString()

I'm relatively new to javascript, so this may be a really simple question. Is there an easy way to stop 'EDT' from printing after a date returned with toLocaleString? Thanks!
Michele
  • 31
  • 2
  • 4
1
2 3 4