NetBeansDeveloperFAQ
This is the developer-oriented FAQ for NetBeans IDE 4.x, 5.x, and 6.x. Developer in this context means "person writing NetBeans extension modules (plug-ins), or applications based on the NetBeans platform". Don't see your developer-oriented question here? Ask on dev@openide.netbeans.org (subscribe to post). Not writing modules? See the list of other FAQs.
For offline use, you can also download the entire FAQ as a giant HTML file. (automatically refreshed daily)
Here's How To Add FAQ Entries. One Big Important Thing about adding developer FAQ entries: If they don't start with "DevFaq" they are not going to get indexed properly. Please add items, but please follow this simple guideline.
IMPORTANT, If you're a Community Member
Once, you're done adding a FAQ as per the above guidelines, please notify NetBeans Community Docs Team by Email.
Getting Started
- Becoming a proficient module developer
- How do I get sources for NetBeans using Mercurial (hg)?
- How do I get zipped sources for a periodic build?
- What API do I want to use for x, y or z?
- I have fixed a bug in NetBeans. Can I contribute the patch?
- I have written a module for NetBeans. Can I contribute it to the NetBeans project?
- I have written a module. Can I sell it?
- Why are some packages org.netbeans.api.something and others are org.netbeans.something.api?
- What is netbeans.exe, who compiles it and why is it there?
- How do I get commit access to NetBeans source repository?
- Where can I find Javadoc for the IDE and Platform?
- Where is the Platform and how can I build it?
- How do I set up a NetBeans Platform in the IDE?
- There sure are a lot of modules in the source tree. What are they for?
Tutorials and important starting points
- What are the basic things I should know about NetBeans' architecture to get started?
- Any tutorials out there, please?
- NetBeans API starting point
- Translating your NetBeans module
- What information is available about threading in the platform?
Getting support, where to find examples
- NetBeans mailing lists - get help from experts all around the globe
- Search the support list for module developers
- Search the NetBeans development mailing list
- Filing a bug report
- Examples of how to use various APIs
- Browse Samples Online
- Where can I find more documentation on certain APIs?
- Consider all of these support options
- Can I get training material for the NetBeans Certification course?
Application Lifecycle and Hooks
Development issues, module basics and classpath issues, and information about RCP/Platform application configuration
- My module uses some libraries. I've tried setting CLASSPATH but it doesn't work. Help!
- How do module dependencies/classloading work?
- How do I have two source directories within one module?
- What classloaders are created by the module system?
- Why can't I load properties using UIDefaults?
- I need to package some third party libraries with my module. How do I do that?
- What is an "NBM"?
- Can I sign NBMs I create?
- My module requires JDK 6 - how do I keep it from being loaded on an older release?
- What is a library wrapper module and how do I use it?
- When should I use a library wrapper module and when should I just package the library into my module?
- How to store external libraries in the NetBeans Hg repository
- How do I add native libraries?
- What is an implementation dependency and what/how/when should I use one?
- My module uses class XYZ from NetBeans' APIs. It compiles, but I get a NoClassDefFoundError at runtime. Why?
- What is a module cluster?
- What is the difference between a suite and a cluster?
- How can I reuse my modules in several RCP applications?
- Can I use modules from update center in my RCP application?
- My project.xml lists more dependencies than I really need. How can I fix it?
- Can I work on just one or two modules from the NetBeans source base by themselves?
- Is there a standard way to provide user documentation (help) for my module?
- Where is TopManager? I'm trying to do the examples from the O'Reilly book
- There is a class under org.netbeans.core that does what I need. Can I depend on it?
- Common calls that should be done slightly differently in NetBeans than standard Swing apps (loading images, localized strings, showing dialogs)
- How do I create a patch for a preexisting NetBeans module?
- I want to use one version of the Platform with another version of the build harness. Can I?
- I am developing a NetBeans module. What performance criteria should it satisfy?
- I want to set some flags or CLI arguments for running my NB RCP/Platform based application (such as disable assertions). How do I do that?
- How can I fix memory leaks?
- How can I profile NetBeans?
- Can I test changes to the IDE without going through the license check and so on?
Configuration: How modules install things
- What are the ways a module can influence the system?
- When do I use what registration method?
- Installing things declaratively vs. installing things programmatically
- What is the "default Lookup"?
- How do I run some code when my module starts/loads/unloads?
- What is a module layer (XML layer) or layer file
- What is the system filesystem
- How can I see the filesystem?
- What are .instance files
- What are .settings files
- What are .shadow files
- What is the user dir, what is in it, and why do I need one?
- How do I specify the order for my menu items/toolbar buttons/files in the system filesystem?
Actions: How to add things to Files, Folders, Menus, Toolbars and more
- How do I add an action to the main menu?
- How do I add an action to a toolbar in the main window?
- How do I make an action that is automatically enabled/disabled depending on what's selected?
- What is the Actions folder in the system filesystem, and why should I use it?
- How do I add an action to all files of a given mime-type?
- How do I add an action to the text-editor popup menu?
- How do I add an action to a project popup menu?
- How do I add an action to a project popup menu of a specific project type?
- How do I add an action to a project popup menu of my own project type?
- How do I add an action to a folder?
- How do I add an action to my custom node?
- How do I make my Node have a submenu on its popup menu?
- How do I add an action to the global popup menu of tabs?
- How do I add a dropdown menu to toolbar?
- How do I add a dropdown menu to toolbar that is selectively enabled/disabled?
- How do I hide/show toolbar dynamically?
- Some module in the IDE etc. already has a menu item I like, but I just want to rename it. Can I?
- Can I change the contents of a menu according to the selected file in the editor, or hide or show a whole menu?
- Can I install submenus into popups or other menus, instead of a regular action?
- How do i change the closing action of the MainWindow?
- How do I get the Open File item on the File menu into my platform application?
- Looking at the UI how do I find a module that implements a menu item
- How can I add a JSeparator to the main toolbar?
- How do I remove Menu Item, Toolbar Button from plug-in's XML Layer?
- How do I have only Shortcut Keys for an Action?
- How do I change the appearance of the menu items and toolbar buttons for my Action
- I need to show a file chooser when my action runs. Can I remember most-recently-used directories?
Key Bindings
- How do key bindings work?
- Binding one key to more than one action
- Why should I use D- for Ctrl and O- for Alt? I thought C- stood for Ctrl and A- stood for Alt!
- I want my action to appear between two existing items/in a specific place in the menu. Can I do that?
- What about editor-specific keybindings?
- Which keybindings are already being used?
Lookup
- What is a Lookup?
- What uses Lookup?
- Why use Lookup - wouldn't a Map be good enough?
- How do I get started using Lookup?
- How do I use Java generics with Lookup?
- What is the "default Lookup"?
- How can I override an instance in the Lookup?
- What is the difference between getCookie(Class), SharedClassObject.findObject(Class) and Lookup.lookup(Class)?
- How do I implement my own lookup or proxy another one?
- If there is more than one of a type in a Lookup, which instance will I get?
- How can I find out what is in a Lookup
- How can I add support for lookups on nodes representing my file type?
- After adding my class to Lookup I get a "ClassNotFoundException" when trying to look it up, why?
- Event Bus in NetBeans
- How do I lazy-load an item in the lookup?
- How can I register services into the lookup using the system filesystem?
Files and Data Objects
- How does NetBeans recognize files?
- What is a FileObject?
- What is a FileSystem?
- What are file attributes?
- What is a DataObject?
- What is a DataLoader?
- How can I be notified when a file is modified and saved?
- How do I add a menu item to the popup menu of every folder in the system?
- Can I add a menu item to the context menu of every Java source file?
- I'm having trouble implementing this filesystem....
- How do I add support for an XML type with a different extension?
- The next button is never enabled when I create my DataObject from a template. Help!
- How can I create a FileObject in memory?
- How can I create declarative MIMEResolver and add new file type?
Converting between common data types and finding things
- FileObjects versus Files
- URIs and URLs
- How do I get a java.io.File for a FileObject?
- How do I get a FileObject for a File?
- How do I get a DataObject for a FileObject?
- How do I get a FileObject for a DataObject?
- How do I get a Node for a DataObject?
- How do I get a DataObject for a Node?
- How do I get a reference to the system filesystem?
- I have a .instance file. How do I get an actual object instance?
- I have a folder full of .instance files. How do I get any/all of the object instances?
Editor and Edited Files
- How can I open a file in the editor in read-only mode?
- Is it safe to programmatically modify a file which is open in the editor?
- How can I get a list of open editor windows?
- How can I get the position of the caret in the currently selected editor window?
- How can I open a particular file at a particular line number?
- Can I add a menu item to the context menu of the Java source editor?
- How can I find the currently open document in the selected editor?
- How can I track what file the user is currently editing?
- I want to make some programmatic changes to the edited file. How can I do it so one Undo undoes it all?
- Can I add syntax coloring for my own data object/MIME type?
- What is MimePath?
- What is MimeLookup?
- How is MimeLookup composed?
- How can I create JEditorPane for a specific document type?
- How to get mime type from Document or JTextComponent?
- How to add code completion to any JEditorPane
- Project Encoding vs. File Encoding - What are the precedence rules used in NetBeans 6.0?
- I want to add annotations to my editor, for errors, or other reasons. How?
Language Parsing Support (e.g., ANTLR, javaCC)
- How can I add support for a new language via javaCC?
- How can I add support for a new language via ANTLR?
Module System
- I want my module to disable some of the modules that would normally be enabled. Possible?
- How do I debug a module I'm building?
- Can I disable Auto Update (for example, while running tests)?
- How can I change the NetBeans splash screen shown when an installed module requires restart?
- How can I obfuscate a module?
- Why am I getting a ClassCastException when the class is clearly of the right type?
- Can two or more modules contain the same package?
- Can I create a console or server (non-GUI) app with the NetBeans Platform?
- How can code in one module be notified when other modules are loaded or unloaded?
- How do I suppress warning messages about loading resources from the default package?
Nodes and Explorer
- What is a Node?
- What is "explorer"?
- What is an ExplorerManager?
- What is an Explorer View?
- How do I show a Node in my explorer view?
- I need to create my own Nodes. What should I subclass?
- How to serialize my nodes?
- I need to show Nodes for objects that are slow to create. How do I compute Node children on a background thread?
- How do I create a TopComponent (tab in the main window) to show some Nodes?
- I have a reference to an existing Node from some other module. Can I add cookies/properties/children?
- Can I add, remove or reorder children of a node on the fly?
- How do I make a particular node visible in the Explorer, and maybe select it?
- How do I get at the file that a particular node represents?
- Tracking selections in the Explorer
- I need to customize the content of my Node's Lookup. How do I do it?
- I need to write some code that tracks the global selection. What should I do?
- How do I "decorate" nodes that come from another module (i.e. add icons, actions)?
- How do I preserve the column attributes of a TreeTableView?
- How do I remove the "..." buttons of a TreeTableView?
- How can I make sortable columns in a TreeTableView?
- How can I add a "View" capability for data my node represents?
- How can I implement "Select all/Deselect all/Invert selection" features?
- Why do my nodes in the Explorer always have an expand-box by them, even though they have no children?
- How can I prevent (or override) the node deletion dialog?
- How can I change my node's appearance?
- How do I handle cut, copy and paste?
- How can I graphically create a ChoiceView?
Command Line Parsing
- Can something that the user sets on the command line determine whether a menu item is enabled?
- Same as the above, but this time for enabling/disabling modules?
- How to pass command line arguments to a NetBeans Platform application when run inside the IDE
- NetBeans Platform parsing command line arguments
Threading
- What is a background thread and why do I need one?
- I need to run some code on a background thread. Can the platform help me?
- When should I use RequestProcessor.getDefault() and when should I create my own RequestProcessor?
- What APIs come with built-in background thread handling
- How can I run an operation occasionally on a background thread, but reschedule it if something happens to delay it?
Settings
- How do I let the user set preferences/options/customization/configuration for my module/application?
- Can I add new panels to the Options window?
- How to register options for export/import to module's layer?
Window System
- What is the window system
- What are Modes?
- What are TopComponents?
- How do I use Matisse/GroupLayout (new form editor/layout manager in 5.0) in my windowing system components
- I want to show my own component(s) in the main window - where do I start?
- Windows and dialogs
- How does the XML API for installing window system components work?
- How do I use .wstcrf/.wsmode/.settings files to install my module's components in the window system?
- My TopComponent always opens in the editor area, but I want it to open in the same place as XYZ
- Why does TopComponent have a getLookup() method? What is it for?
- I want to disable the popup menu on the toolbars in the main window. How do I do that?
- How can I change the executable's icon?
- How does the window system really work?
- How can I replace the Window System?
- How do I set the initial size of the main window?
- Secrets of the NetBeans Window System
- How can I change my TopComponent to not be a singleton?
Dialogs API
XML Multiview API
- How do I get started with the XML Multiview API? Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7
Project Types
- Is it possible to extend an existing project type?
- How to add a new panel to a Project Properties dialog?
- How do I add an action to a project popup menu?
- How do I add an action to a project popup menu of a specific project type?
- How do I identify the "main project"?
Saving
- Help, the Save menu item is disabled!
- Hmmm. Is there a better solution?
- I have a Save menu item, but no Save button in the toolbar!
Printing
Wizards and Templates
- How do I make a file template which actually creates a set of files at once?
- I am creating a non-IDE application. How do I enable/control templates?
- How do I get started using FreeMarker to generate my templates? (and this plugin might help too)
- How do I use different templates for different areas?
- How do I show that a user has filled an invalid input into my wizard?
Properties and PropertySheet
- How do I change the default behavior of PropertySheet editors?
- How do I show my node's properties in the Properties view?
- How do I display different groups of properties on buttons in the property sheet the way Matisse does?
- How do I color the cells in a property sheet?
- How do I display an icon in my property sheet?
Output Window
- How do I create my own tab in the output window and write to it?
- How do I route the output from an external process to the output window?
- How to implement custom IOProvider?
- How do I embed output window tab to another component?
Using Enterprise Resources from NetBeans module
- Java EE Application Client on top of NetBeans Platform Tutorial
- How to call EJB from NetBeans module
Writing tests
- Testing things that use FileObjects
- Writing Tests for DataObjects and DataLoaders
- How Do I Set Up Automated Builds and Testing For My Platform Application?(NOTE: applies to 6.5M1 and earlier)
- How do I write GUI tests for NetBeans Platform apps? (NOTE: applies to 6.5M1 and earlier)
- Do you have an example of a GUI test for NetBeans Platform apps? (NOTE: applies to 6.5M1 and earlier)
- How do I test a 6.5M2 or later platform-based application?
- How do I test something which uses the System Filesystem?
Branding your application
Authentication and Authorization in Platform Apps
- Building a Login Screen for a NetBeans Platform Application: Part 1, Part 2 and Part 3
- Other strategies for authentication and authorization
Logging and Error Handling
- Using java.util.logging in NetBeans
- UI Logging through Gestures Collector
- How can I suppress the Unexpected Exception dialog?
Tip of the Day
JavaHelp
- How do I fix problems about 'ide.welcome'?
- How do I change the default help topic?
- How do I change "IDE Help" in the title bar?
- How do I remove the helpset?
- How do I connect ui to JavaHelp?
- Why doesn't my JavaHelp content show up?
Custom Project Types
- How do I create a Custom Project Type?
- Why don't previously opened editors return when I re-open my project?
Look and Design
- DevFaqChangeLookAndFeel
- I have a custom component. How can I make it respond to --fontsize like the rest of NetBeans
Deploying Changes through AutoUpdate and using Autoupdate API
- How can I use AutoUpdate to deploy updates and new modules for my application?
- How can I update the splash screen, title bar and other branding items via AutoUpdate?
- How can I set the interval at which AutoUpdate checks its servers?
- How can I find Javadoc of Autoupdate API with hints to use it?
- What other documentation is available about AutoUpdate?
- How to specify post-install code in NBM?
- How to install components using its custom installers? (since NB6.5)
- How to update NetBeans Platform Application silently?
Programmatic access to Java Sources
The following applies only to NetBeans 6.0 and later. See Java_DevelopersGuide for details.
- How do I Get All Methods/Fields/Constructors of a Class?
- How do I do modification to a source file?
- How to obtain a source file for a Java class and open in the editor?
- How can I scan a classpath to find all classes of a particular type?
When things go wrong: Troubleshooting
- I've got a class not found error/exception. How can I fix it?
- I find files missing from the source ZIP file

