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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:07:37+00:00 2026-05-15T20:07:37+00:00

public final class BrowserTopComponent extends TopComponent implements ActionListener, ChangeListener, LookupListener{ public BrowserTopComponent() { initComponents();

  • 0
public final class BrowserTopComponent extends TopComponent implements ActionListener, ChangeListener, LookupListener{

    public BrowserTopComponent() {
        initComponents();
        setName(NbBundle.getMessage(BrowserTopComponent.class, "CTL_BrowserTopComponent"));
        setToolTipText(NbBundle.getMessage(BrowserTopComponent.class, "HINT_BrowserTopComponent"));
//        setIcon(ImageUtilities.loadImage(ICON_PATH, true));

        Browser1 fff = new Browser1();
        associateLookup(Lookups.singleton(fff));
    }

    private Lookup.Result result = null;

    @Override
    public void componentOpened() {
        result = Utilities.actionsGlobalContext().lookupResult(Browser1.class);
        result.addLookupListener (this);
    }

    @Override
    public void componentClosed() {
        result.removeLookupListener (this);
        result = null;
    }

  private void navButtonActionPerformed(java.awt.event.ActionEvent evt) {
    fff.navgiateTo(); // NET BEAN COMPLAINS AT THIS LINE.
    }

any possible reasons why I cannot use fff.navigateTo(); But when fff.navigateTo() is inside the constructor of BrowserTopComponent, it works fine! So why can I not have it outside the constructor ?

In my Browser module (which loads 3rd party JAR), I have the following class:

package my.app.browser
import bunch.of.3rd.party.stuff
public class Browser1 {

    private String url;

    public void navigateTo() {

        System.out.println(url);
    }
}
  • 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-15T20:07:38+00:00Added an answer on May 15, 2026 at 8:07 pm

    This looks like a scoping issue. fff is declared locally in the constructor. In navButtonActionPerformed, it isn’t declared at all. This might be due to how you snipped the code, but if the error message implies that fff is not declared, try declaring “Browser fff” at the class level. For instance,

    class BrowserTopComponent ... {
    
      Browswer fff = new Browser();
    
      BrowserTopComponent() {
        initComponents();
      }
    
      private void navButtonActionPerformed(ActionEvent evt) {
        fff.navigateTo();
      }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The class Object contains the following method: public final Class<? extends Object> getClass(). why
@Entity @Table(name = parent) public final class Parent extends Base { @OneToOne(cascade = CascadeType.PERSIST,
JodaTime has public final class DateTime extends BaseDateTime {...} which works its way up
public final class MyScreen extends MainScreen { /** * Creates a new MyScreen object
I created a class like this public final class MyView extends View { public
I'm using JDK 1.5, here is my class: public final class Account implements ICAccount
I'm trying to make this code generic: public final Object unwrap(Class arg0) { throw
Lets assume following classes definition: public class A { public final static String SOME_VALUE;
I wrote two methods in class Util: public static final <T> T[] copy1(T[] source)
Say I have a class: public class R { public static final int _1st

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.