All Questions
Tagged with concurrency swing
347
questions
0
votes
2
answers
78
views
Java Swing rendering inconsistencies and flickering
I'm trying to familiarize myself with making GUIs in java and wrote a program that should move a square on the screen depending on WASD key inputs (Following an online tutorial).
However, when running ...
0
votes
1
answer
37
views
Need a good way to pause between programmatic GUI updates so user can see what occurred before next action [duplicate]
I've been trying to code a simple graphical Yahtzee where, once it is the computer's turn, the user can see each of up to three CPU dice rolls for a few seconds before the next is displayed. But ...
0
votes
0
answers
30
views
NullPointerException on timer [duplicate]
//swing class, An object named foo(frame showing time each second)
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {...
-1
votes
1
answer
57
views
JOptionPane makes my program crash when I join thread
I am writing a program to rename files. Once the user selects the folder the files are processed in a thread. After the thread finishes the program closes the GUI and opens the selected folder. For ...
0
votes
0
answers
118
views
Creating an efficient "Do you want to save before exiting?" tab exiting
I am creating a swing clone of Notepad and I'm trying to figure out a way to improve the "do you want to save before exiting tab part.
I have a method that is called when the user wants to exit ...
1
vote
3
answers
160
views
Wait for long-running operation and show popup
Is it possible to wait for a method (say METHOD1) to finish, but if it is running longer than X secs, call another method until METHOD1 returns?
Some pseudocode:
method1();
startCountdown(1000); // ...
1
vote
0
answers
59
views
I'm currently trying to update a JTextArea thanks to threads
My project aims to integrate a terminal into a Swing App. The problem is that some blocking commands are blocking the stream. That is why I would like to read with a buffer into the Standard output ...
0
votes
1
answer
260
views
Kafka messaging and GUI data exchange in java
I have an application that is required to use Kafka as the messaging system. I also have a GUI that takes user inputs. The application is set up to kick off heavy crunching when receiving a message ...
3
votes
1
answer
199
views
How can I implement a method that returns a result to Event Dispatch Thread?
I have the following method:
public Object someMethod(Object param) {
return performLongCalculations();
}
Some time consuming calculations I placed in a separate method:
private Object ...
1
vote
1
answer
40
views
How to deliver object to a long-running SwingWorker from the EDT?
How can the EDT communicate to an executing SwingWorker? There a lot of ways for the SwingWorker to communicate information back to the EDT - like publish/process and property changes but no defined ...
0
votes
0
answers
100
views
JTextArea is not updating [duplicate]
I have a code where I'm taking input from user and after clicking on SUBMIT button it executes my logic and shows user a JTextArea on a new frame but the problem is it shows after program executes ...
0
votes
0
answers
82
views
Synchronize the paint() method of a Java Canvas instance?
Basically I am running a java emulator at 60 FPS and each time the screen refreshes it draws pixels from an array and paints it to the screen. I am getting a java.util.ConcurrentModificationException ...
0
votes
0
answers
108
views
Swing view blank on second start
I made a Conway's Game of Life. The first round works fine. A grid of white and black panels represent life and dead cells. The view is refreshed to display the change in every generation. However ...
0
votes
0
answers
46
views
SwingWorker Thread doesn't stop action in background
My SwingWorker doesn't stop the background thread from executing when I call .cancel(true); I've tried loads of different things - running the background process on it's own thread, calling the method ...
0
votes
2
answers
84
views
Is it possible to make my JFrame button to constantly prints outputs
What the program is supposed to do:
Has a OK BUTTON: outputs the users time every 1000ms
Has a CLOSE button: stops the OK BUTTON and have no outputs
Is it possible to make my actionlistener for my ...