Linked Questions
16 questions linked to/from Is MVC in Swing Thread Safe
21 votes
2 answers
11k views
Can't get ArrayIndexOutOfBoundsException from Future<?> and SwingWorker if thread starts Executor
I play with multitreading for SwingWorker by using Executor, and I'm there by mistake identified wrong elements from the Vector, looks like as this code pretty ignores that element in Vector doesn't ...
3 votes
3 answers
5k views
MVC many view and one controller
In my application there are many views(sub components) and only one controller. Selecting some options in one view can change the layout and number of components in another view. The controller ...
4 votes
1 answer
4k views
How to correctly communicate between two different MVC Controllers in Java Swing?
Can you explain me how a Controller can call another Controller method in a simple but still correct way? Please provide some code! background: I Have 2 different Controllers-View-Model and 2 ...
4 votes
1 answer
3k views
Java MVC - problems adding a MouseListener
I am a Java student and just ended the basic functionality of a little command line card game. The game is a simplified version of Magic-type trading card game. There is no AI, you play against ...
1 vote
3 answers
2k views
Multiple Jpanel with buttons in one Jframe on MVC, how do I get the actionlistener in my controler ?
this is a homework btw, I am asked to make a jframe containing multiple jpanels which have buttons and action listeners attached to them. I have to use the MVC model to do it but, since my buttons/...
1 vote
1 answer
4k views
How to notify changes when implementing MVC-based GUI
So far, I have implemented a GUI based on Swing, and according to the MVC pattern like (here), where events are fired from both view (by using JComponents capabilities) and model (by using ...
4 votes
3 answers
217 views
Downsides to using a single ActionListener for all Components?
For routing action requests, I'd like to use a single ActionListener instance for all Components. Calls on actionPerformed could be differentiated using setActionCommand. Is this advised ? Are there ...
2 votes
1 answer
2k views
progress bar not updating with threads
ok, I'm here again to ask one dummy question. I have a custom dialog frame and have progress bar on it. So also I have a genetic algorithm (which works pretty big amount of time). As I understand all ...
1 vote
2 answers
2k views
Firing events from inner class which extends SwingWorker
I am trying to fire events from inner class, but it is not working. This is my code: ABSTRACT MODEL: public abstract class AbstractModel { public PropertyChangeSupport propertyChangeSupport; ...
0 votes
1 answer
3k views
PropertyChangeListener on objects inside a List
My problem is that when I change the value from a property of my model the PropertyChangeSupport fires but the PropertyChangeListener in the view is never reached. So I guess I am making something ...
1 vote
3 answers
421 views
Java: read values continuously to multiple jprogressbars that never completes
I have 3 "JProgressBars" in a Java GUI application, which I need to keep updating the values at constant time intervals. This is my application and highlighted are the progress meters which I want to ...
0 votes
3 answers
696 views
In Java using Swing, how can I know when all threads launched with invokeLater have finished?
Inside a createAndShowGUI() method called by javax.swing.SwingUtilities.invokeLater like this...: public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() {...
0 votes
4 answers
239 views
does swing view needs synchronized methods if its set by new threads in controller
There is actually more than 1 question. Given Model View and Controller. (Mine are coupled a lot - View knows its Controller, and Controller knows View.) Does new threads in Controller can be fired ...
2 votes
1 answer
436 views
Java EDT and Spawning Dialogues
I am trying to learn the intricacies of Swing, and have read a great deal about the Event Dispatch Thread. I understand what is for, however am struggling with the following concept: I have a JFrame ...
-3 votes
2 answers
186 views
SwingWorker, again, but new
So, I figured out the SwingWorker thing. However, another problem emerged (go figure)... Swing worker acctually manages error reporting and email sending, and emailing being a lenghty (more than .5 ...