Issue
I'm am doing this Netbeans tutorial and i got stuck on this part.(https://platform.netbeans.org/tutorials/nbm-feedreader.html#three)
Here is the code I have for the class implemented:
package org.myorg.feedreader;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.windows.TopComponent;
/**
*
* @author Kidnapinn
*/
@TopComponent.Description(
preferredID = "FeedTopComponent",
persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(
mode = "explorer",
openAtStartup = true)
@ActionID(
category = "Window",
id = "org.myorg.feedreader.FeedTopComponent")
@ActionReferences({
@ActionReference(
path = "Menu/Window",
position = 0)
})
@TopComponent.OpenActionRegistration(
displayName = "#CTL_FeedAction")
@Messages({
"CTL_FeedTopComponent=Feed Window",
"HINT_FeedTopComponent=This is a Feed Window"})
private FeedTopComponent() {
setName(Bundle.CTL_FeedTopComponent());
setToolTipText(Bundle.HINT_FeedTopComponent());
}
public class FeedTopComponent extends TopComponent {
}
I'm a noob at Java so i don't know what i'm doing wrong. Can you help me?
Solution
Add 'NbBundle' to your imports:
import org.openide.util.NbBundle.*;
This worked for me. You might need to add 'Base Utilities API' as a dependency to your FeedReader module. (Project Properties, Libraries, Module Dependencies, Add Dependency;. There is obviously a mistake in the tutorial somewhere as this solution relies on a deprecated import, but it should run now.
Answered By - James Chalmers
Answer Checked By - Mildred Charles (JavaFixing Admin)