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 1077139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:31:55+00:00 2026-05-16T21:31:55+00:00

I understand the How to Use Actions tutorial, but can’t figure out how to

  • 0

I understand the “How to Use Actions” tutorial, but can’t figure out how to make it work between multiple JFrame forms.
I tried making updateComboBox method public static so it could just be accessed from other forms,
but the NetBeans IDE refused to allow it since the auto-generated non-static variable jComboBox cannot be referenced from a static context.
The primary form contains a JComboBox that needs to be modified based on user input (menus, buttons, text fields, etc.).
Some of the widgets are on the primary form, others are on secondary forms.
For example, the primary form makes a secondary form visible; the secondary form makes some changes to the configuration; then the user hides the secondary form by pressing the SAVE button.
How can the secondary form best let the primary form know that the configuration has been updated and changes now need to be applied to the JComboBox?
Is an Action a good fit for this or would some other method be more appropriate?

public class Controller extends javax.swing.JFrame {
    ...
    private javax.swing.JComboBox jComboBox;
    private void updateComboBox() {
        String[] names = Configuration.getNames();
        for (String n : names) {
            jComboBox.addItem(n);
        }
        ...
  • 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-16T21:31:55+00:00Added an answer on May 16, 2026 at 9:31 pm

    How about a controller class which will hold references to your frames and manage the signaling you need? You can also take a look at the Observer pattern, where your primary form will listen the changes made by the secondary form.

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

Sidebar

Related Questions

I read a tutorial in Django site but I don't understand how to use
I understand how to use Protoype in standard Javascript with Node.js and modules, but
I was reading this to understand zend's MVC Request Lifecycle. But i can't think
Instead of using windows/forms authentication can I just use authorize attributes on the control
I understand the utility of the rake command, but what kinds of custom actions
I was reading into using Quartz http://quartznet.sourceforge.net/tutorial/lesson_3.html but I don't understand how to implement.
I want to understand the use of xargs man in Rampion's code : screen
I don't really understand the use and concept of an Intent. I DO understand
I am learning Django and I am trying to understand the use of models.py
I'm trying to find some easy to understand and use tutorials for D3 that

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.