Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Menu Bar

The menu bar of an application based on the NetBeans Platform is built by the Platform itself via the System Filesystem. Every menu (as well as the menu entries) is defined in the module layer file. This allows each module to declaratively add its menu entries to the menu bar. With NetBeans Platform 7 this is even easier. Just implement the action performed when selecting a menu entry; that way, this action is supplied with an annotation and the corresponding layer entries are automatically created out of these annotations.

In Chapter 6, you learned how to create and annotate action classes. In this section you will learn how to integrate actions into the menu bar.

Creating and Positioning Menu and Menu Entries

When creating an action with the action wizard of the NetBeans IDE (see Chapter 6) you can easily assign it to a menu and position it in the desired location via the wizard GUI. So you know what happens meanwhile in the background—to change something later or to be able to get by without the support of the NetBeans IDE—I will explain the process of creating menu entries for your own actions.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint