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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:30:55+00:00 2026-05-26T02:30:55+00:00

I would like to use Window Builder and use the MVC paradigm simultaneously. It

  • 0

I would like to use Window Builder and use the MVC paradigm simultaneously. It is very messy with a complex window when Window Builder adds all the code to just one file.

I would like the default file created to be the ‘view’.

I would like to keep my control actions (event listeners) in a ‘controller’ class. Is there a way to have Window builder automatically put the event listeners in a class of your choice rather than adding to one monolithic file?

  • 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-26T02:30:56+00:00Added an answer on May 26, 2026 at 2:30 am

    I don’t know how Eclipse’s Window Builder works, but I do know that NetBean’s creates anonymous inner classes that call a custom method for each button and then allows the programmer to alter the body of the custom method. If Eclipse is similar, then you can simply have this custom method call a method of your Control object. Sure it adds a layer of indirection, but it’s a small price to pay to give you complete control over your control.

    For instance, if I create a JButton called “myButton” and then have the code generator create an action for my button, it will create this code:

        myButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                myButtonActionPerformed(evt);
            }
        });
    

    and will allow me to access and write code in the generated method, myButtonActionPerformed:

    private void myButtonActionPerformed(java.awt.event.ActionEvent evt) {
       // TODO add your handling code here:
    }
    

    And inside of this method I would call my Control’s method:

    private void myButtonActionPerformed(java.awt.event.ActionEvent evt) {
       if (myControl != null) {
          myControl.myButtonAction();
       }
    }
    

    The control class could look something like

    class MyControl {
    
        void myButtonAction() {
            //TODO: implement control code
        }
    
    }
    

    The GUI would need a setControl(MyControl myControl) method in order to “inject” the control into the GUI.

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

Sidebar

Related Questions

I would like to use the HTML5 window.history feature to implement full AJAX navigation
Good day all I have the following question: I would like to use Chart
I'm adding TreeViewItems manually in code behind and would like to use a DataTemplate
I would like to use QColorDialog not as a dialog window but as a
I would like to use the window.history.pushState() function in supporting browsers. Unfortunately I'm getting
I would like to use HyperLink of ASP.Net to open a new window when
I have a .NET Framework 2.0 app and would like to use the Windows
I would like to use mod_rewrite() on my apache setup on a windows machine.
I have an In-house windows form app that I would like to use Spell
I am using xampp on Windows, but I would like to use something closer

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.