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

  • Home
  • SEARCH
  • 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 3959984
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:47:54+00:00 2026-05-20T02:47:54+00:00

UPD: Solved! Good day! I started develop JAVA GUI apps in netbeans 6.9.1 (I

  • 0

UPD: Solved!

Good day!

I started develop JAVA GUI apps in netbeans 6.9.1 (I use matisse). So I decided to implement windowListener in my program but I have met the problem. I can’t access to the main frame!

Does anyone know how to deal with that problem?

UPD:
I don’t get any exceptions and etc. I can’t add listener for main frame because i don’t know to to get access!

Here is example of generated code:

public class INotePadView extends FrameView 
{

  public INotePadView(SingleFrameApplication app)
  {
      super(app);

      initComponents(); //autogenerated method, nothing interesting.

      // status bar initialization - message timeout, idle icon and busy animation, etc
      ResourceMap resourceMap = getResourceMap();
      int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
      messageTimer = new Timer(messageTimeout, new ActionListener() {
          public void actionPerformed(ActionEvent e) {
              statusMessageLabel.setText("");
          }
      });

      messageTimer.setRepeats(false);
      int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
      for (int i = 0; i < busyIcons.length; i++) {
          busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
      }

      busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
          public void actionPerformed(ActionEvent e) {
              busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
              statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
          }
      });

      idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
      statusAnimationLabel.setIcon(idleIcon);
      progressBar.setVisible(false);

      // connecting action tasks to status bar via TaskMonitor
      TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
      taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
          public void propertyChange(java.beans.PropertyChangeEvent evt) {
              String propertyName = evt.getPropertyName();
              if ("started".equals(propertyName)) {
                  if (!busyIconTimer.isRunning()) {
                      statusAnimationLabel.setIcon(busyIcons[0]);
                      busyIconIndex = 0;
                      busyIconTimer.start();
                  }
                  progressBar.setVisible(true);
                  progressBar.setIndeterminate(true);
              } else if ("done".equals(propertyName)) {
                  busyIconTimer.stop();
                  statusAnimationLabel.setIcon(idleIcon);
                  progressBar.setVisible(false);
                  progressBar.setValue(0);
              } else if ("message".equals(propertyName)) {
                  String text = (String)(evt.getNewValue());
                  statusMessageLabel.setText((text == null) ? "" : text);
                  messageTimer.restart();
              } else if ("progress".equals(propertyName)) {
                  int value = (Integer)(evt.getNewValue());
                  progressBar.setVisible(true);
                  progressBar.setIndeterminate(false);
                  progressBar.setValue(value);
              }
          }
      });

  }

  @Action
  public void showAboutBox() {
      if (aboutBox == null) {
          JFrame mainFrame = INotePadApp.getApplication().getMainFrame();
          aboutBox = new INotePadAboutBox(mainFrame);
          aboutBox.setLocationRelativeTo(mainFrame);
      }
      INotePadApp.getApplication().show(aboutBox);
  }

//Other generated code

ANSWER:
I found the way how to solve this problem.

WindowListener winListener = new TestWindowListener();
    JFrame mainFrame = super.getFrame();
    mainFrame.addWindowListener(winListener);

I think that it could be useful for someone.

  • 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-20T02:47:54+00:00Added an answer on May 20, 2026 at 2:47 am

    Look at the Javadoc for the application framework (hard to find, but it’s here) :

    WindowListener winListener = new TestWindowListener();
    JFrame mainFrame = app.getMainFrame();
    mainFrame.addWindowListener(winListener);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day pythonians, I want to make a custom dictionary with two main features:
I want to use icons like opened/closed folder in my table (UITableView)? UPD: For
I had a problem this week (which thankfully I've solved in a much better
I work on Spring MVC + Hibernate application, use MySQL (ver. 5.0.51a) with the
I working on some applications that route tcp and upd traffic through multiple machines
Or should I just copy all the files from bin\Release\ excluding .pdb? UPD :
Are there any standard tools, or recommended approaches for async tasks execution? UPD I
I wrote a program who paints widget on desktop wallpaper, under desktop icons, and
I have a problem concerned with losing of precision my task is to print
I have div, which has id 'content'. It's visible. <div id=wrapper style=display:block> <div id=content>

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.