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

Book Description

Over 70 highly focused practical recipes to maximize your output with NetBeans

  • Covers the full spectrum of features offered by the NetBeans IDE

  • Discover ready-to-implement solutions for developing desktop and web applications

  • Learn how to deploy, debug, and test your software using NetBeans IDE

  • Another title in Packt's Cookbook series giving clear, real-world solutions to common practical problems

In Detail

Java IDEs have grown bigger and more complicated with time. Some development environments even require the user to spend countless hours searching for more software to bundle with the IDE just to start working. NetBeans abstracts much of the work needed to configure the environment and makes it convenient for Java developers to start coding straight away. With this book in hand you will tap into the endless possibilities of developing modern desktop and web applications in Java.

NetBeans IDE 7 Cookbook is perfect for you if you are ready to take the next step from the standard tutorials and move into the practical world. It will show you all the features of the NetBeans IDE used by Java developers. It goes to great lengths in explaining different ways of achieving a desired goal and uncovering features present in NetBeans that are often overlooked or forgotten.

The NetBeans IDE 7 Cookbook will appeal to Java programmers at all levels who are ready to go beyond just tutorials.

A practical solution reference with a series of to-the-point recipes that will help Java developers with all kinds of NetBeans development tasks

Table of Contents

  1. NetBeans IDE 7 Cookbook
    1. Copyright
    2. Credits
    3. About the Author
    4. About the Reviewers
    5. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    6. 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. Errata
        3. Piracy
        4. Questions
    7. 1. NetBeans Head First
      1. Introduction
      2. Creating a Java Project Using Wizard
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      3. Creating libraries
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      4. Sharing libraries
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. File Structure or Project Structure?
          2. What is the advantage of a separate ANT build file?
      5. Importing Projects from Eclipse
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Synchronizing Eclipse
          2. More error dialogs
      6. Importing existing Maven Projects
        1. Getting ready
        2. How to do it...
        3. How it works...
    8. 2. Basic IDE Usage
      1. Introduction
      2. Creating a Java Project using Maven support
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Speeding Maven development
          2. Editing POM
        5. See also
      3. Creating a package
        1. How to do it...
        2. How it works...
        3. There's more...
          1. The Files tab
          2. Automatic creation of packages
      4. Creating a class
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Other file types
      5. Running the main class
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Run class shortcut
          2. Run project shortcut
      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
      7. Creating constructors
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Default constructor creation
      8. Generating toString(), equals(), and hashCode()
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. hashCode() and equals() rules
      9. Generating getters and setters
        1. Getting ready
        2. How to do it...
        3. There's more...
          1. Addition of newer get/set methods
    9. 3. Designing Desktop GUI Applications
      1. Introduction
      2. Creating a Java Desktop Application
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Check the source for the Mars Rover Viewer
          2. Preview Design
        4. See also
      3. Creating a Frame
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Changing the look and feel of your application
          2. Checking the generated code
          3. Where to find the default closing behavior
      4. Creating a Panel
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Reusing JPanels
          2. Editing text label of components
      5. Adding Event Listeners
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Components Properties Window
      6. Connecting your Application to a Database
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Registering a new database
          2. Checking the contents of Customer.java
          3. Using the Inspector to check for Binding
      7. Creating a customized icon for your application
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Adding a Splash screen
          2. Application Properties and About box
      8. Making executable Java Desktop Applications
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Executing the JAR file
          2. Contents of the JAR file
    10. 4. JDBC and NetBeans
      1. Introduction
      2. Setting up with MySQL
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Creating Databases
          2. Running the Administration Tool
      3. Setting up with PostgreSQL
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Connecting and disconnecting
      4. Setting up with Apache Derby/Java DB
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Viewing data
      5. Setting up with Oracle
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Built-in SQL editor
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Select connection on editor
          2. Insert record button
    11. 5. Building Web Applications
      1. Introduction
      2. Creating a web project using the wizard
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. HTTP Server Monitor
      3. Introduction to Java EE 6 using NetBeans
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Writing JUnit tests to your EJB
          2. Deployment descriptor is optional when creating servlets
          3. Deploy on Save
      4. Adding JSF as a web framework
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Running index.xhtml
      5. Using JSF as a web framework
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Creating your own template
      6. Using Apache Struts as a web framework
        1. How to do it...
        2. How it works...
      7. Using GWT as a web framework
        1. Getting ready
        2. How to do it...
        3. How it works...
    12. 6. Using JavaFX
      1. Introduction
      2. Creating a JavaFX Project
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Available samples
      3. Build UI with NetBeans JavaFX Composer
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Changing the name of the application
          2. Changing the font of the labels
      4. Connecting JavaFX Application to Web Service
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Connecting JavaFX Application to Database
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Application States in JavaFX
        1. Getting ready
        2. How to do it...
        3. How it works...
    13. 7. EJB Application
      1. Introduction
      2. Creating EJB project
        1. Getting ready
        2. How to do it...
        3. How it works...
      3. Adding JPA support
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. Creating Stateless Session Bean
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Creating Stateful Session Beans
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. GlassFish and sessions
      6. Sharing a service through Web Service
        1. How to do it...
        2. How it works...
        3. There's more...
          1. Testing the web service
      7. Creating a web service client
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Other services
    14. 8. Mobile Development
      1. Introduction
      2. Creating CLDC/MIDP applications
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Deploying applications on different device models
          2. Adding more Platforms
      3. Creating CDC applications
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Running the project
      4. Using the Visual Mobile Designer
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Organizing the Layout
      5. Beautifying your mobile application
        1. Getting ready
        2. How to do it...
        3. How it works...
    15. 9. Java Refactoring
      1. Introduction
      2. Renaming elements
        1. How to do it...
        2. How it works...
      3. Moving elements
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. Extracting a superclass
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Implementing parent class methods
        5. Extracting an interface
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Creating interfaces for classes that already implement interfaces
            2. Undoing interface exctraction
            3. Refactoring options
        6. Encapsulating fields
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Understanding encapsulate fields options
    16. 10. Extending the IDE
      1. Introduction
      2. Creating a new project Wizard
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Different wizard behavior
          2. Adding an icon
      3. Creating a new file wizard
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. Creating options panels
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Saving parameters
          2. Loading parameters
          3. Secondary panel
          4. Keywords
    17. 11. Profiling and Testing
      1. Introduction
      2. Profiling Java code
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Profiler calibration
          2. VM telemetry overview
          3. Comparing profiling snapshots
      3. Creating unit tests
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      4. Using SQE for improved code quality
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      5. Monitoring HTTP connections
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Editing HTTP requests from within NetBeans
      6. Using the JMeter load generator
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. JMeter+NetBeans profiler
          2. Editing the JMX file
    18. 12. Version Control
      1. Introduction
      2. Adding a project to Subversion
        1. Getting ready
        2. How to do it...
        3. How it works...
      3. Checking in modifications
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Show changes
          2. Diff window
      4. Working with a Subversion branch
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Merging branches
      5. Resolving conflicts in Subversion
        1. Getting ready
        2. How it works...
      6. Creating a Mercurial project
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. Status of server files
      7. Cloning a Mercurial repository
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Committing to a Mercurial project
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
            1. For moments when that commit did not sit so well