Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can build a Swing CRUD application on the NetBeans Platform by splitting it into modules: a data-access library with JPA entities, a viewer that presents records, and an editor that creates or changes them. The classic tutorial uses NetBeans Platform 6.8, Java DB, and customer records; that version is a historical setup, not a verified recipe for a current JDK and IDE. The maintained Apache NetBeans tutorials explain the workflow for Ant and Maven projects, but both pages say they need review: Ant CRUD tutorial and Maven CRUD tutorial.

What you are building

This is more than a standalone Swing form. A NetBeans Platform application is a rich-client suite that hosts separately packaged modules. In this example, JPA entity classes map relational tables to Java objects, a viewer displays records, and an editor changes them. The tutorial uses Java DB and a CUSTOMER table, with DISCOUNT_CODE and MICRO_MARKET included where relationships apply. It says the approach can be used with other relational databases supported by the IDE, but does not establish current-version database support guarantees. Apache NetBeans CRUD tutorial

For an historically faithful 6.8 walkthrough, you would need the archived IDE and a compatible Java and database setup. Current documentation does not certify which archived wizards, bundled Java DB setup, JDK assumptions, or dependency versions still work together.

Choose Ant or Maven project setup

Approach What changes What carries over
Ant Create a NetBeans Platform application, then a Java class library for the entity classes. The IDE wizard generates entity classes and persistence.xml from database tables. The tutorial’s Java CRUD patterns and module structure.
Maven Begin with NetBeans Platform Maven archetypes and resolve the project’s dependencies and database access. The official tutorial assumes familiarity with Maven and recommends introductory Maven material for beginners. The Maven tutorial says the Ant tutorial’s Java implementation applies once the Maven setup differences are understood.

These are workflow differences, not performance comparisons. Neither tutorial guarantees compatibility with every modern Maven, JDK, IDE, or database combination. Apache NetBeans Maven CRUD tutorial

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create the suite and JPA data library

  1. Create a NetBeans Platform application project. Treat the suite as the container that brings the application modules together.

  2. Create a Java class library for the data-access code. In the Ant workflow, use the IDE’s Entity Classes from Database wizard to select tables and generate the JPA entity classes and persistence.xml.

  3. Build the library with its dependent JARs available for packaging. The tutorial’s example uses Java DB and customer-related tables; configure a database service your chosen environment can actually reach.

The generated entity classes represent relational data; they do not by themselves provide a finished user interface or a complete persistence design.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build the viewer: prototype first, then Explorer

Start with a simple Swing prototype

The tutorial first demonstrates the data flow with a JTextArea: obtain an EntityManager, run a named query for customers, and show each customer’s name and city. It is a useful way to confirm that entity configuration and database access work before building the platform UI. It is not presented as a production data-access architecture.

Expose records through Nodes and Explorer

For the platform-style viewer, represent records with NetBeans Nodes and display them in an Explorer view. The tutorial names ExplorerManager and BeanTreeView, and describes synchronizing the selected node with the Properties window. That gives the view platform context and selection behavior that a plain text area does not provide. Apache NetBeans CRUD tutorial

Add a separate editor module

Put record editing in its own module and use a TopComponent for the editor window, with Swing fields for the selected customer’s values. Connect the viewer’s selection to the editor so it can display the right record. The tutorial discusses platform save and undo concepts, including AbstractSavable and UndoRedo.Manager, so edits can participate in the platform’s save and undo behavior.

Keeping viewer and editor separate means another editor can be installed for the same viewer. The tutorial also warns that putting data-access calls directly in UI code is a design weakness for larger applications; a more loosely coupled data layer is preferable as the application grows. Apache NetBeans CRUD tutorial

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Implement the CRUD operations

The tutorial’s sequence is Read, Update, Create, then Delete. Read and Update are demonstrated in the viewer/editor progression; Delete is left as an exercise, so its exact action wiring and persistence code are not specified by the tutorial.

Read

Load records through JPA and present them in the viewer. The prototype uses a named query for all customers, while the platform version exposes records through nodes.

Update

Let the editor show the selected record, track changes, and save them through the platform save flow and JPA persistence. Use undo support where appropriate rather than treating every Swing field change as an immediate database write.

Create

Add a platform action that opens or activates the editor in a new-record state. Populate the necessary fields, then persist the new entity through the data layer. The official tutorial’s modular design provides the pieces, but the exact create-action implementation depends on how the application connects its UI and persistence code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Delete

  1. Bind a delete action to the selected customer node and make it available through an appropriate menu, toolbar, or shortcut.

  2. Ask the user to confirm deletion before changing persistent data.

  3. Delete the corresponding entity through JPA and refresh or remove the node so the viewer reflects the result.

This is the implementation outline implied by the tutorial’s exercise, not a verbatim completed solution: the tutorial asks the reader to create the action, confirm, and remove the selected record. Apache NetBeans CRUD tutorial

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check the project before relying on it

What the 6.8 title means today

The original title is associated with a Java DB and JPA tutorial for NetBeans Platform 6.8. DZone: How to Create a Swing CRUD Application on NetBeans Platform 6.8 The practical value now is the architecture and sequence—JPA entities, modular viewer and editor, and platform actions—not an assumption that the old IDE instructions will run unchanged in a current environment.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.