Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6069721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:51:10+00:00 2026-05-23T09:51:10+00:00

I did a big GUI Based App and I have now many many Action

  • 0

I did a big GUI Based App and I have now many many Action stuff around there…
I have different Listeneres, like ActionListener, KeyAdapters, …
Everything should run threaded, so my GUI isnt freezing when do long time operations. So im using SwingWorker in every ActionListener…
Currently its working like this: I have my JComponents, bound on one single ActionListener. In this Listener I decide what to do, based on the actionCommand(). The I call a method, which contains my SwingWorker and the Action which should be performed.

Ii dont like this concept anymore, because my class is getting longer and longer and i dont have an overview about all the functionallity. So I decided to do it another way…
I thought Factory Methods would be a great thing, but here is my problem with them: I need sometimes data from my GUI, eg: when pressing JButton x, what is in JTextField y and so on…
so what is the best practise for this? Should I just give my Factory a instance of my complete GUI? Or a ArrayList of Components? Another problem is that need to change values from my GUI, eg: press button x and then filter a JTable… how should i do that?
doing it like this = myFactory.process(this); isnt really that what i want…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:51:10+00:00Added an answer on May 23, 2026 at 9:51 am

    Take a look at JGoodies Binding: it emphasizes the use of PM (PresentationModel) where all the GUI state is stored (and bound to the actual GUI components).

    Every View has an associated PM that makes the link with the domain model. PM can live without the View (but the reverse is not true).

    PM should not have any GUI-related dependency (so that it is unit testable without the GUI), hence no reference to a JTextField, JButton…

    However, PM normally includes Actions that are attached to buttons from the View. Actions are not actual GUI components (although they belong to javax.swing package.

    I said “normally” because some Actions may need to display a message box, open a new window… This kind of actions should then be put in another class. Note that Karsten Lentzsch (JGoodies author) doesn’t talk about this case in his presentations (this is my own way of dealing with this case).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a big div with some links inside, I'd like to have the
I recently did some work modifying a Python gui app that was using wxPython
I have a big flinq query that returns, among many other things, a date
Why did some processor manifacturers decide to use Little endian Big endian Middle endian
Big problem. I'm not sure what it was that I did, but it seems
Did you ever have to choose between WISA or LAMP at the beginning of
Did Microsoft abandon support for Windows Presentation Foundation (WPF) on Visual Studio 2005? There
I recently did a big update on my wordpress site, thus some old permalink
Unfortunately I did several times git reset --hard HEAD^ losing a quite big chunk
I have pretty big table with lots of columns. I want to find all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.