Questions tagged [eventqueue]

77 questions
1
vote
2 answers

What does EventQueue.invokeLater do and that vs start() Thread?

Hi im new in Opp and Java. I have see something about thread, implements Runnable , start() to call the call the run(). But what does this do? EventQueue invokeLater(); Or this full line that you can find in this post on the main…
DavidASG
  • 68
  • 6
1
vote
0 answers

Distributed priority queue with efficient arbitrary deletes?

I'm looking at using two Strict Fibonacci Queues—queue_0 and queue_1—where queue_0 holds the datetime ordered events (key) and queue_1 holds the deletes. Then I can simply run: if(queue_0->findMin() == queue_1->findMin()) queue_0->deleteMin(),…
A T
  • 13,008
  • 21
  • 97
  • 158
1
vote
2 answers

New to Java. Getting strange error in calculator program when pressing any button

I've only been working with Java for about a month now so I don't exactly have a complete grasp on it yet. I have been assigned to make a calculator program with a GUI for class. I got everything working besides the fact that the user can enter in…
Mark Shimala
  • 65
  • 10
1
vote
2 answers

Javascript mousemove event queue

In Javascript, is it possible in a mousemove event handler to determine if there are any pending mousemove events in the queue? Or, preferably, is it possible to make the event queue skip all mousemove events in the queue except for the most recent…
XDR
  • 4,070
  • 3
  • 30
  • 54
1
vote
1 answer

save EventQueue events and restore

Is it possible to save pending events from event queue and then restore them? There is following workflow: user click on JTable row and there is a check if row is changed, depending on that check modal confirmation window is opened. When user double…
michael nesterenko
  • 14,222
  • 25
  • 114
  • 182
1
vote
2 answers

How to share information between GUI threads?

I’m writing a client application with an accompanying GUI (Swing). My two classes, ClientClass and MainFrame, are running different threads yet need to call methods in one another. ClientClass instantiates the GUI (MainFrame) at some point during…
Ramsey
  • 279
  • 2
  • 3
  • 9
0
votes
0 answers

Why don't jobs in a Celery chain pass their result to next job when wrapped in a chord?

I am using Flask with Celery to add tasks to my event queue powered by redis. Currently, I have a flask route that creates a celery chord, and runs it on the worker. The header of this chord is a chain, and the body is a group of chain (a bunch of…
0
votes
1 answer

Is there a way to know the functioning of the event queue in pygame?

from time import time import pygame pygame.init() t = time() Events = pygame.event.get() print(Events) end = False while not end: if time()-t>3: print(Events) Events = pygame.event.get() t = time() I wrote the…
Prakhar
  • 17
  • 4
0
votes
0 answers

The execution order of setTimeout and AJAX onload callback function

I am fairly new to javascript and after having a basic understanding of how event loop, callback queue and webAPIs work together to achieve asynchronous in Javascript. I have a following simple code including setTimeout and AJAX to test if my…
mrWayne
  • 21
  • 3
0
votes
2 answers

JAVA GUI Button Question

so I have some code that looks like this: import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import…
This 0ne Pr0grammer
  • 2,632
  • 14
  • 57
  • 81
0
votes
0 answers

Sending remainder email dynamically node js

I have an application where I have to remind the user 1 week, 2 days and also 2 hours before of the appointment date. I have implemented this with cron-job already, but wanted to know is there any better approach, such as event queues,…
Kiran Uppunda
  • 43
  • 1
  • 6
0
votes
1 answer

Avoiding Race Condition with event queue in event driven embedded system

I am trying to program stm32 and use event driven architecture. For example I am going to toggle a pin when timer interrupt occurs and transfer some data to external flash when ADC DMA buffer full interrupt occurs and so on.. There will be multiple…
NOpE
  • 1
  • 1
0
votes
0 answers

console log inside a setTimeout unexpected delay

The following code gives an unexpected result. It only waits for the 1sec delay (and not the 5 seconds specified by the delayBySeconds() function) then prints the output as given below. function func(){ const delaySeconds = 5; …
Hamid Ali
  • 29
  • 6
0
votes
0 answers

Why do functions from event queue aren't called even when main executions stack is empty?

I was reading an article on event queue. And the authour say " funcitons from event queue aren't executed until they find the main execution stack empty " and to demonstrate the same he provide the following example function documentClickHandler()…
0
votes
1 answer

Java Swing Components Init NullPointerException

I'm trying to have a simple app that lets you pick some files and does some logic with them. I've created the interface via the JFrame Palette builder incorporated in IntelliJ IDEA. public class App extends JFrame implements ActionListener { JPanel…