You are previewing NetBeans IDE 8 Cookbook.
O'Reilly logo
NetBeans IDE 8 Cookbook

Book Description

Over 75 practical recipes to maximize your productivity with NetBeans

In Detail

From the start to the end of a Java project's lifecycle, this book will show you how to perform many key tasks with the NetBeans IDE, uncovering more about mobile, desktop, and enterprise Java along the way.

You will start by creating Java projects and learning how to refactor and use NetBeans tools to increase developer efficiency. You will then get a walkthrough of how to create a desktop application before covering JavaFX and mobile applications and how to use external services within them. Having seen how to create many different types of applications, you will then be shown how to test and profile them before storing them in revision control systems such as Git or Subversion. Finally, you will learn how to extend NetBeans itself by adding new features to the IDE.

What You Will Learn

  • Develop a variety of application types using different libraries with Ant, Maven, and NetBeans
  • Refactor code efficiently and quickly
  • Manage databases with ease from within your IDE
  • Configure your mobile development environment
  • Develop enterprise applications using the latest Java EE 7 technologies
  • Version-control your applications with a variety of different providers
  • Use the latest testing and profiling tools
  • Extend NetBeans with an array of new features
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. NetBeans IDE 8 Cookbook
      1. Table of Contents
      2. NetBeans IDE 8 Cookbook
      3. Credits
      4. About the Authors
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Using NetBeans Projects
        1. Introduction
        2. Creating a Java application
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        3. Creating a Maven application
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
            1. Invoking Maven goals
            2. Invoking custom Maven goals
            3. Using a different installation of Maven
        4. Using Maven projects
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        5. Creating a Free-Form application
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
            1. Using a different version of Ant
        6. Creating a library
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        7. Importing an Eclipse project
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Synchronizing Eclipse
            2. Errors when importing Eclipse projects
      9. 2. Java Development with NetBeans
        1. Introduction
        2. Creating a package
          1. How to do it…
          2. How it works…
          3. There's more...
            1. The Files explorer
            2. Automatic creation of packages
        3. Creating a class
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Creating an interface
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        5. Running a file
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        6. Debugging a class
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
            1. Conditional breakpoints
            2. Other ways to check variable content
            3. Different kinds of debuggable applications
            4. Debugging the application rather than a class
        7. Formatting the code
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Collapsing and expanding code folds
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        9. Toggling comments
          1. Getting ready
          2. How to do it…
          3. How it works…
        10. Fixing and organizing imports
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        11. Creating file headers
          1. Getting ready
          2. How to do it…
          3. There's more...
        12. Changing the look and feel of NetBeans
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
      10. 3. NetBeans Productivity
        1. Introduction
        2. Creating a constructor
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        3. Creating a logger
          1. Getting ready
          2. How to do it…
        4. Creating a toString() method
          1. Getting ready
          2. How to do it…
          3. There's more...
        5. Creating a property
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        6. Overriding a method
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Rename refactoring
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        8. Move refactoring
          1. Getting ready
          2. How to do it…
          3. There's more...
        9. Copy refactoring
          1. Getting ready
          2. How to do it…
          3. There's more...
        10. Delete refactoring
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        11. Change parameters refactoring
          1. Getting ready
          2. How to do it…
          3. There's more
        12. Pull up / push down refactoring
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
            1. Pull up refactoring
        13. Extract interface refactoring
          1. Getting ready
          2. How to do it…
          3. There's more...
            1. Extracting superclasses
        14. Encapsulate fields refactoring
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        15. Replacing a constructor with the Factory pattern
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
            1. Replacing constructors with the Builder pattern
      11. 4. Developing Desktop Applications with NetBeans
        1. Introduction
        2. Creating a Swing application
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        3. Adding components to a form
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        4. Creating menus
          1. Getting ready
          2. How to do it…
          3. There's more...
        5. Creating dialogs
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        6. Creating toolbars
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Responding to events
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        8. Building a distributable application from NetBeans
          1. Getting started
          2. How to do it…
          3. How it works…
          4. There's more...
      12. 5. NetBeans Enterprise Application Development
        1. Introduction
        2. Adding WildFly support to NetBeans
          1. Getting ready
          2. How to do it …
          3. How it works…
        3. Adding TomEE support to NetBeans
          1. Getting ready
          2. How to do it …
          3. How it works …
        4. Creating a web application
          1. Getting ready
          2. How to do it…
          3. How it works …
          4. There's more
        5. Creating a web application with JSF support
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more
        6. Adding JSF support to a web application
          1. Getting ready
          2. How to do it…
          3. How it works …
          4. There's more
        7. Creating a JSF composite component
          1. Getting ready
          2. How to do it …
          3. How it works…
          4. There's more
        8. Creating an EJB
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more
            1. What EJBs are deployed?
        9. Creating a Message Driven EJB
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more
        10. Creating a timer
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more
        11. Creating a REST web service
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more
        12. Using the Chrome Connector
          1. Getting ready
          2. How to do it…
          3. There's more
      13. 6. Managing Databases with NetBeans
        1. Introduction
        2. Connecting to Java DB
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Registering and managing a MySQL Server
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
            1. Creating databases
            2. Running the administration tool
        4. Connecting to Microsoft SQL Server and Oracle
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Connecting to an Oracle database
        5. Connecting to PostgreSQL
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Connecting and disconnecting
        6. Managing a SQL database
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
            1. Viewing data
            2. Creating indexes
            3. Inserting, deleting, and amending data graphically
            4. Exporting schemas
        7. Connecting to MongoDB
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. The MongoDB shell
      14. 7. NetBeans JavaFX
        1. Introduction
        2. Creating a JavaFX application
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Creating all user interfaces in FXML
            2. Manually creating controllers
        3. Graphical editing of FXML files
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Styling a JavaFX application with CSS
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Creating and using a JavaFX custom control
          1. Getting ready
          2. How to do it…
          3. There's more…
        6. Deploying a self-contained application
          1. Getting ready
          2. How to do it…
          3. There's more…
      15. 8. NetBeans Mobile Development
        1. Introduction
        2. Adding mobile support to NetBeans
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Creating an MIDP application
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Adding Android support to NetBeans
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Creating an Android application
          1. Getting ready
          2. How to do it…
          3. How it works…
      16. 9. Version Control
        1. Introduction
        2. Initializing a Git repository
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Initializing a Mercurial repository
        3. Cloning a Git repository
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Cloning a Mercurial repository
            2. Updating to a specific revision
        4. Checking out from a Subversion repository
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Importing files into a Subversion repository
            2. Using CVS from within NetBeans
        5. Getting the history of a file
          1. Getting ready
          2. How to do it…
          3. There's more…
        6. Committing and pushing code changes
          1. Getting ready
          2. How to do it…
          3. There's more…
            1. Managing new files
        7. Creating a Diff patch
          1. Getting ready
          2. How to do it…
          3. There's more…
            1. Applying a Diff patch
        8. Branching a repository
          1. Getting ready
          2. How to do it…
          3. There's more…
      17. 10. NetBeans Testing and Profiling
        1. Introduction
        2. Installing JUnit support into NetBeans
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Creating a JUnit test for an existing class
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Creating a JUnit test
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Creating a JUnit test suite
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Running tests
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more...
        7. Creating a TestNG unit test
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Profiling an application
          1. Getting ready
          2. How to do it…
          3. There's more…
      18. 11. Using External Web Services
        1. Introduction
        2. Getting a list of Delicious bookmarks
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Adding a Delicious bookmark
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Getting a list of recent photos on Flickr
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Geocoding with Google Maps
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Verifying an e-mail address with StrikeIron
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        7. Adding an additional web service into NetBeans
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
      19. 12. Extending NetBeans
        1. Introduction
        2. Creating a NetBeans module
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Packaging a NetBeans module for deployment
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
      20. Index