How to Create a Swing CRUD Application on NetBeans Platform 6.8
Update
In this section, you first create an editor. The editor will be provided by a new NetBeans module. So, you will first create a new module. Then, within that new module, you will create a new TopComponent, containing two JTextFields, for each of the columns you want to let the user edit. You will need to let the viewer module communicate with the editor module. Whenever a new Node is selected in the viewer module, you will add the current Customer object to the Lookup. In the editor module, you will listen to the Lookup for the introduction of Customer objects. Whenever a new Customer object is introduced into the Lookup, you will update the JTextFields in the editor.
Next, you will synchronize your JTextFields with the NetBeans Platform's Undo, Redo, and Save functionality. In other words, when the user makes changes to a JTextField, you want the NetBeans Platform's existing functionality to become available so that, instead of needing to create new functionality, you'll simply be able to hook into the NetBeans Platform's support. To this end, you will need to use the UndoRedoManager, together with the SaveCookie.
- Create a new module, named CustomerEditor, with org.shop.editor as its code name base.
- Right-click the CustomerEditor module and choose New | Window Component. Make sure to specify that the window should appear in the editor position and that it should open when the application starts. In the final panel of the wizard, set "Editor" as the class name prefix.
- Use the Palette (Ctrl-Shift-8) to add two JLabels and two JTextFields
to the new window. Set the texts of the labels to "Name" and "City" and
set the variable names of the two JTextFields to jTextField1
and jTextField2.
In the GUI Builder, the window should now look something like this:

- Go back to the CustomerViewer module and change its layer.xml
file to specify that the CustomerTopComponent window will appear in the explorer mode.
Note: Right-click the application project and choose "Clean", after changing the layer.xml file. Why? Because whenever you run the application and close it down, the window positions are stored in the user directory. Therefore, if the CustomerViewer was initially displayed in the editor mode, it will remain in the editor mode, until you do a "Clean", thus resetting the user directory (i.e., thus deleting the user directory) and enabling the CustomerViewer to be displayed in the position currently set in the layer.xml file.
- Run the application and make sure that you see the following when the
application starts up:

- Now we can start adding some code.
Firstly, we need to show the currently selected Customer object in the editor:
- Start by tweaking the CustomerViewer module so that the current Customer object
is added to the viewer window's Lookup whenever a new Node
is selected. Do this by creating an AbstractNode, instead of a BeanNode,
in the CustomerChildFactory class. That enables you to add the
current Customer object to the Lookup of the Node,
as follows (note the "Lookups.singleton(c)" below):
@Override
protected Node createNodeForKey(Customer c) {
Node node = new AbstractNode(Children.LEAF, Lookups.singleton(c));
node.setDisplayName(c.getName());
node.setShortDescription(c.getCity());
return node;
// try {
// return new BeanNode(c);
// } catch (IntrospectionException ex) {
// Exceptions.printStackTrace(ex);
// return null;
// }
} - Let's now change the editor module in such a way that its window will end up listening for Customer objects being added to the Lookup. First, set a dependency in the editor module on the module that provides the entity class, as well as the module that provides the persistence JARs.
- Next, change the EditorTopComponent class signature
to implement LookupListener:
public final class EditorTopComponent extends TopComponent implements LookupListener
- Override the
resultChanged so that the JTextFields are updated whenever
a new Customer object is introduced into the Lookup:
@Override
public void resultChanged(LookupEvent lookupEvent) {
Lookup.Result r = (Lookup.Result) lookupEvent.getSource();
Collection<Customer> coll = r.allInstances();
if (!coll.isEmpty()) {
for (Customer cust : coll) {
jTextField1.setText(cust.getName());
jTextField2.setText(cust.getCity());
}
} else {
jTextField1.setText("[no name]");
jTextField2.setText("[no city]");
}
} - Now that the LookupListener is defined,
we need to add it to something. Here, we add it to
the Lookup.Result obtained from the global context.
The global context proxies the context of the selected Node.
For example, if "Ford Motor Co" is selected in the tree hierarchy,
the Customer object for "Ford Motor Co" is added to the Lookup
of the Node which, because it is the currently selected Node,
means that the Customer object for "Ford Motor Co" is now available in
the global context. That is what is then passed to the resultChanged,
causing the text fields to be populated.
All of the above starts happening, i.e., the LookupListener becomes active, whenever the editor window is opened, as you can see below:
@Override
public void componentOpened() {
result = Utilities.actionsGlobalContext().lookupResult(Customer.class);
result.addLookupListener(this);
resultChanged(new LookupEvent(result));
}
@Override
public void componentClosed() {
result.removeLookupListener(this);
result = null;
} - Finally, declare the result variable at the top of the class, like this:
private Lookup.Result result = null;
- Run the application again and notice that the editor window
is updated whenever you select a new Node:

However, notice what happens when you switch the focus to the editor window:

Because the Node is no longer current, the Customer object is no longer in the global context. This is the case because, as pointed out above, the global context proxies the Lookup of the current Node. Therefore, in this case, we cannot use the global context. Instead, we will use the local Lookup provided by the Customer window.
Now, whenever a new Node is created, which happens when the user selects a new customer in the viewer, a new Customer object is added to the Lookup of the Node.
Since the editor window is opened when the application starts, the LookupListener is available at the time that the application starts up.
Rewrite this line:
result = Utilities.actionsGlobalContext().lookupResult(Customer.class);
To this:
result = WindowManager.getDefault().findTopComponent("CustomerTopComponent").getLookup().lookupResult(Customer.class);The string "CustomerTopComponent" is the ID of the CustomerTopComponent, which is a string constant that you can find in the source code of the CustomerTopComponent. One drawback of the approach above is that now our EditorTopComponent only works if it can find a TopComponent with the ID "CustomerTopComponent". Either this needs to be explicitly documented, so that developers of alternative editors can know that they need to identify the viewer TopComponent this way, or you need to rewrite the selection model, as described here by Tim Boudreau.
If you take one of the above approaches, you will find that the context is not lost when you switch the focus to the EditorTopComponent, as shown below:

Note: Since you are now using AbstractNode, instead of BeanNode, no properties are shown in the Properties window. You need to provide these yourself, as described in the Nodes API Tutorial.
- Start by tweaking the CustomerViewer module so that the current Customer object
is added to the viewer window's Lookup whenever a new Node
is selected. Do this by creating an AbstractNode, instead of a BeanNode,
in the CustomerChildFactory class. That enables you to add the
current Customer object to the Lookup of the Node,
as follows (note the "Lookups.singleton(c)" below):
- Secondly, let's work on the Undo/Redo functionality. What we'd
like to have happen is that whenever the user makes a change to one
of the JTextFields, the "Undo" button and the "Redo" button,
as well as the related menu items in the Edit menu, become enabled. To
that end, the NetBeans Platform makes the UndoRedo.Manager available.
- Declare and instantiate a new UndoRedoManager at the top of the
EditorTopComponent:
private UndoRedo.Manager manager = new UndoRedo.Manager();
- Next, override the getUndoRedo() method in the EditorTopComponent:
@Override
public UndoRedo getUndoRedo() {
return manager;
} - In the constructor of the EditorTopComponent, add
a KeyListener to the JTextFields and, within
the related methods that you need to implement, add the UndoRedoListeners:
jTextField1.getDocument().addUndoableEditListener(manager);
jTextField2.getDocument().addUndoableEditListener(manager); - Run the application and show the Undo and Redo functionality in action, the buttons as well as the menu items. The functionality works exactly as you would expect. You might want to change the KeyListener so that not ALL keys cause the undo/redo functionality to be enabled. For example, when Enter is pressed, you probably do not want the undo/redo functionality to become available. Therefore, tweak the code above to suit your business requirements.
- Declare and instantiate a new UndoRedoManager at the top of the
EditorTopComponent:
- Thirdly, we need to
integrate with the NetBeans Platform's Save functionality:
- By default, the "Save All" button is available in the
NetBeans Platform toolbar. In our current scenario, we do not
want to save "all", because "all" refers to a number of different
documents. In our case, we only have one "document", which is the
editor that we are reusing for all the nodes in the tree hirerarchy.
Remove the "Save All" button and add the "Save" button instead, by adding
the following to the layer file of the CustomerEditor module:
<folder name="Toolbars">
<folder name="File">
<file name="org-openide-actions-SaveAction.shadow">
<attr name="originalFile" stringvalue="Actions/System/org-openide-actions-SaveAction.instance"/>
<attr name="position" intvalue="444"/>
</file>
<file name="org-openide-actions-SaveAllAction.shadow_hidden"/>
</folder>
</folder> - Set dependencies on the Dialogs API and the Nodes API.
- In the EditorTopCompontn constructor, add a
call to fire a method (which will be defined in the next step)
whenever a change is detected:
public EditorTopComponent() {
...
...
...
jTextField1.getDocument().addDocumentListener(new DocumentListener() {
public void insertUpdate(DocumentEvent arg0) {
fire(true);
}
public void removeUpdate(DocumentEvent arg0) {
fire(true);
}
public void changedUpdate(DocumentEvent arg0) {
fire(true);
}
});
jTextField2.getDocument().addDocumentListener(new DocumentListener() {
public void insertUpdate(DocumentEvent arg0) {
fire(true);
}
public void removeUpdate(DocumentEvent arg0) {
fire(true);
}
public void changedUpdate(DocumentEvent arg0) {
fire(true);
}
});
//Create a new instance of our SaveCookie implementation:
impl = new SaveCookieImpl();
//Create a new instance of our dynamic object:
content = new InstanceContent();
//Add the dynamic object to the TopComponent Lookup:
associateLookup(new AbstractLookup(content));
}
...
...
... - Here are the two methods referred to above. First, the method
that is fired whenever a change is detected. An implementation of
the SaveCookie from the Nodes API is added to the InstanceContent
whenever a change is detected:
public void fire(boolean modified) {
if (modified) {
//If the text is modified,
//we add SaveCookie impl to Lookup:
content.add(impl);
} else {
//Otherwise, we remove the SaveCookie impl from the lookup:
content.remove(impl);
}
}
private class SaveCookieImpl implements SaveCookie {
@Override
public void save() throws IOException {
Confirmation message = new NotifyDescriptor.Confirmation("Do you want to save \""
+ jTextField1.getText() + " (" + jTextField2.getText() + ")\"?",
NotifyDescriptor.OK_CANCEL_OPTION,
NotifyDescriptor.QUESTION_MESSAGE);
Object result = DialogDisplayer.getDefault().notify(message);
//When user clicks "Yes", indicating they really want to save,
//we need to disable the Save action,
//so that it will only be usable when the next change is made
//to the JTextArea:
if (NotifyDescriptor.YES_OPTION.equals(result)) {
fire(false);
//Implement your save functionality here.
}
}
} - Run the application and notice the enablement/disablement of the
Save button:

- Next, we add JPA code for persisting our change.
Do so by replacing the comment "//Implement your save functionality here."
The comment should be replaced by all of the following:
EntityManager entityManager = Persistence.createEntityManagerFactory("CustomerLibraryPU").createEntityManager();
entityManager.getTransaction().begin();
Customer c = entityManager.find(Customer.class, customer.getCustomerId());
c.setName(jTextField1.getText());
c.setCity(jTextField2.getText());
entityManager.getTransaction().commit();
When you now run the application, you will see a different icon in the toolbar. Instead of the "Save All" button, you now have the "Save" button available.
Note: Right now, nothing happens when you click OK in the dialog above. In the next step, we add some JPA code for handling persistence of our changes.
Note: The "customer" in customer.getCustomerId() is currently undefined. Add the line "customer = cust;" in the resultChanged (as shown below), after declaring Customer customer; at the top of the class, so that the current Customer object sets the customer, which is then used in the persistence code above to obtain the ID of the current Customer object.
@Override
public void resultChanged(LookupEvent lookupEvent) {
Lookup.Result r = (Lookup.Result) lookupEvent.getSource();
Collection<Customer> c = r.allInstances();
if (!c.isEmpty()) {
for (Customer customer : c) {
customer = cust;
jTextField1.setText(customer.getName());
jTextField2.setText(customer.getCity());
}
} else {
jTextField1.setText("[no name]");
jTextField2.setText("[no city]");
}
} - By default, the "Save All" button is available in the
NetBeans Platform toolbar. In our current scenario, we do not
want to save "all", because "all" refers to a number of different
documents. In our case, we only have one "document", which is the
editor that we are reusing for all the nodes in the tree hirerarchy.
Remove the "Save All" button and add the "Save" button instead, by adding
the following to the layer file of the CustomerEditor module:
- Run the application and change some data. Currently, we have no "Refresh"
functionality (that will be added in the next step) so, to see the changed data, restart the application. Here, for
example, the tree hierarchy shows the persisted customer name for "Toyota Motor Co":

- Fourthly, we need to
add functionality for refreshing the Customer viewer. You might want to
add a Timer which periodically refreshes the viewer.
However, in this example, we will add
a "Refresh" menu item to the Root node so that the user will be able
to manually refresh the viewer.
- In the main package of the CustomerViewer module,
create a new Node, which will replace the AbstractNode
that we are currently using as the root of the children in the
viewer. Note that we also bind a "Refresh" action to our
new root node.
public class CustomerRootNode extends AbstractNode {
public CustomerRootNode(Children kids) {
super(kids);
setDisplayName("Root");
}
@Override
public Action[] getActions(boolean context) {
Action[] result = new Action[]{
new RefreshAction()};
return result;
}
private final class RefreshAction extends AbstractAction {
public RefreshAction() {
putValue(Action.NAME, "Refresh");
}
public void actionPerformed(ActionEvent e) {
CustomerTopComponent.refreshNode();
}
}
} - Add this method to the CustomerTopComponent, for refreshing
the view:
public static void refreshNode() {
EntityManager entityManager = Persistence.createEntityManagerFactory("CustomerLibraryPU").createEntityManager();
Query query = entityManager.createQuery("SELECT c FROM Customer c");
List<Customer> resultList = query.getResultList();
em.setRootContext(new CustomerRootNode(Children.create(new CustomerChildFactory(resultList), true)));
} - In your save functionality, add the call to the method above so that, whenever data is saved, an automatic refresh takes place. You can take different approaches when implementing this extension to the save functionality. For example, you might want to create a new module that contains the refresh action. That module would then be shared between the viewer module and the editor module, providing functionality that is common to both.
- Run the application again and notice that you have a new root node,
with a "Refresh" action:

- Make a change to some data, save it, invoke the Refresh action, and notice that the viewer is updated.
Now replace the code above in the constructor of the CustomerTopComponent with a call to the above. As you can see, we are now using our CustomerRootNode instead of the AbstractNode. The CustomerRootNode includes the "Refresh" action, which calls the code above.
- In the main package of the CustomerViewer module,
create a new Node, which will replace the AbstractNode
that we are currently using as the root of the children in the
viewer. Note that we also bind a "Refresh" action to our
new root node.
Also check that the BeanTreeView in the CustomerViewer will stretch horizontally and vertically when the user resizes the application. Check this by opening the window, selecting the BeanTreeView, and then clicking the arrow buttons in the toolbar of the GUI Builder.
You have now learned how to let the NetBeans Platform handle changes to the JTextFields. Whenever the text changes, the NetBeans Platform Undo and Redo buttons are enabled or disabled. Also, the Save button is enabled and disabled correctly, letting the user save changed data back to the database.





Comments
Craig Ringer replied on Wed, 2009/12/09 - 12:17am
Geertjan Wielenga replied on Wed, 2009/12/09 - 12:27am
Excellent feedback, ringerc. That will be fixed. Thank you. One approach is to register actions in the layer file which then enables you to add an attribute to the layer entry. That attribute causes the action to be processed asynchronously, (which is a new feature in 6.8, i.e., the ability to mark an action as being asynchronous). These asynchronous actions can simulate SwingWorker:
class MyAction implements ActionListener, Runnable {
public MyAction(MyContext c) {
assert EventQueue.isEventThread();
// setup inside AWT thread, get what is important from c
}
public void actionPerformed(AE ev) {
assert !EventQueue.isEventThread();
// run off AWT thread
// perform the work
SwingUtilities.invokeLater(this);
}
public void run() {
assert EventQueue.isEventThread();
// finish in AWT and update the UI
}
}
Another approach would be to use SwingWorker. These approaches will be added to the article, though note that threading on the NetBeans Platform is also discussed here: http://wiki.netbeans.org/NetBeansDeveloperFAQ#Threading
Something else that's possible is to integrate with the NetBeans progress bar, which can be achieved with, literally, 3 lines of code.
Suraj Chhetry replied on Wed, 2009/12/09 - 4:04am
Thanks for great toturail. Could you tell me how can I create flollowing type of menu at TopComponent how can i do this ?
Root
----Customers
- Greetjan
-Orders
+Raw-12092009
+Raw-11091009
+Balance
+Reports
Florian Brunner replied on Thu, 2009/12/10 - 5:42am
Hi Geertjan,
great to have another tutorial about this topic. Thanks!
Though I haven't read all of it yet, I already have one enhancement question:
As you know, the NetBeans IDE provides a project template to create the skeleton of a CRUD application based on the Swing Application Framework.
Maybe it would be useful to have a project template to create the skeleton of a CRUD application based on the NetBeans Platform, too. What do you think?
-Florian
Geertjan Wielenga replied on Sun, 2009/12/13 - 6:51am
Dans Cut replied on Mon, 2009/12/14 - 10:40am
Geertjan Wielenga replied on Mon, 2009/12/14 - 12:06pm
in response to:
Dans Cut
Geertjan Wielenga replied on Mon, 2009/12/14 - 6:56pm
Hi surajchchetry, that's a great idea. If I understand it correctly. This is the kind of project structure I am creating at the moment, for a new tutorial, based on your suggestion above.
A new tutorial should appear within the next week or two, to explain how to create project structures like the above, with a bunch of additional features too, as described here in my blog!
Nguyen Khiem replied on Mon, 2009/12/21 - 7:23am
Kevin Jaques replied on Sun, 2010/01/03 - 12:25pm
Kevin Jaques replied on Sun, 2010/01/03 - 12:47pm
em.setRootContext(new AbstractNode(Children.create(new CustomerChildFactory(resultList), true)));"
That also drives home part of the reason for the change.Kevin Jaques replied on Sun, 2010/01/03 - 1:02pm
Farouk Alhassan replied on Tue, 2010/01/19 - 3:08pm
Hi Geertjan
Thank you very much for such a great tutorial. Following the tutorials from here and the JPA intergration in the Definitive guide to Netbeans Platform I am trying to develop a real database application from the concepts explained. I am however not getting a any success.
In this tutorial, the EntityManager is created in the constructor of the TopComponent class which is not very efficient for obvious reasons and will also be a night mare to maintain if every TopComponent creates its own Entitymanager. I therefore tried the Installer approach used in the Netbeans Platform book but that didn't work. I kept getting ClasscastException when retreiving the objects via creating the nodes for the Viewer with ExplorerManager.
protected boolean createKeys(List<Pupilidentifiers> list) {
for (Pupilidentifiers identifier : resultList) {
list.add(identifier);
}
return true;
}
Que 1. What is the recommended way of using these API's and JPA in a production environment?
To get my application off the ground,
I have now moved the Node creation code to the componentOpened() method and calling the entity manager creation directly but that is throwing the following errors with regards
associateLookup(ExplorerUtils.createLookup(exm, map));
java.lang.IllegalStateException: Trying to set lookup ProxyLookup(class=class org.openide.explorer.DefaultEMLookup)->[org.openide.explorer.DefaultEMLookup$NoNodeLookup@5b695ffa, org.openide.util.Lookup$Empty@375212bc, org.openide.util.lookup.SingletonLookup@631c44f8] but there already is java.lang.ref.WeakReference@54f4289d for component: PupilViewer.PupilTopComponent[Pupil Window,0,0,0x0,invalid,layout=javax.swing.GroupLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=256,maximumSize=,minimumSize=,preferredSize=]
at org.openide.windows.TopComponent.setLookup(TopComponent.java:1252)
Que 2. Is it not possible to call that method in the componentOpened() method?
Vladimír Duša replied on Tue, 2010/02/09 - 3:29pm
Hi Geertjan,
thanks for this super tutorial - it helped me a lot.
I still have a problem with saving the customer. The save button works as I expect, but the save action is not invoked during closing the TopComponent and switching between customers. After few hours of googling I have no Idea how to do it using SaveCookie and SaveCookieImpl model. Is there a possibility, to manually invoke the same save action as the save button? It would be good to invoke this save action in componentClosed() and resultChanged() methods.
Thank you very much
Vladimír Duša
John Hetherington replied on Wed, 2010/05/26 - 8:16pm
Started working through this article on Netbeans 6.8, completed the read section successfuly and got the tree displaying with the properties synchronised. Commenced on the update section and got down to Step 4 which states Go back to the Customer Viewer module and change the layer.xml file and specify that the CustomerTopComponent window will appear in the explorer mode.
Has anyone the neccessary xml code to add here to make this happen as none is included in the article??
Kind Regards
John In New Zealand
Ralph Lance replied on Tue, 2010/06/29 - 4:38am
in response to:
John Hetherington
Hadi Setyono replied on Thu, 2010/07/01 - 5:32am
Andreas Niepsch replied on Tue, 2010/07/20 - 6:02am
Hi Geertjan,
thank's for this tutorial. It's a very good start for developing Rcp and Database-Applikations.
I have two questions:
1. If i close "Customer Window" the content of "Editor Window" isn't clear, wy??? or what should i do?
I think if a TComponent is closed the Lookup of is is not longer in the Global Context and not displayed in
the "Editor Windows" ????
2. The save-button is enabled if i mouseClicked in "Editor Window". Enabling if changed content of the
form is better in this sample.
Thank you
Andreas
Craig Ringer replied on Tue, 2010/07/27 - 2:41am
There are issues with driving Swing directly with JPA entities when you start doing anything non-trivial, involving larger amounts of data. You start to need to lazily load parts of entities or entity relationships, and have to worry about how much data you're retaining in memory at once. This gives rise to issues with EDT blocking again, and major problems with managing JPA session lifetimes.
If you're going to be working with enough data that you don't want to download it from the database server all at once, think very carefully about whether this is the approach for you.
Anyone considering writing a non-trivial app driven directly by JPA data access should read this excellent article:
http://blog.schauderhaft.de/2008/09/28/hibernate-sessions-in-two-tier-rich-client-applications/
... and possibly my own inferior writing on the topic, which covers some issues not considered by the above link:
http://soapyfrogs.blogspot.com/2010/07/jpa-and-hibernateeclipselinkopenjpaetc.html
The only solutions I've found to the issues involve writing a (probably complex and boilerplate-heavy) mid-tier to buffer between Swing and JPA.
Craig Ringer replied on Tue, 2010/07/27 - 2:57am
in response to:
Farouk Alhassan
@gcameo: I'm not the smartest developer around, nor the strongest JPA expert, but my personal advice after recent experience trying to use JPA in a Swing app is: run, run, as fast as you can.
You'll have to write a midlayer to mediate between Swing and your JPA data access to get acceptable performance, avoid blocking the UI, etc. Even then it'll be "interesting" to manage JPA session lifetimes. I'm currently seriously considering ripping JPA out of my app entirely and going back to JDBC, because I'm finding it creates more problems than it solves in a 2-tier Swing app.
I'd be glad to be proved wrong, of course. Just so long as that "wrong" doesn't involve some comment about how you should "obviously" write a 3-teir appserver based monstrosity that communicates with the Swing rich client via RMI. I don't have an army of bored coders who need make-work, I need to get a real application written ;-)
I have direct personal messages enabled, and my email address is:
python -c "print 'Y3JhaWdAcG9zdG5ld3NwYXBlcnMuY29tLmF1\n'.decode('base-64')"I don't seem to get email comment reply notifications, though.
Tj Harple replied on Tue, 2011/02/15 - 5:05pm
Hi Geertjan
Thank you very much for such a great tutorial. This is only my 2nd tutorial with Java 1.6.0_23 & NetBeans 6.9.1 on Windows 7. I was following the tutorial here : http://platform.netbeans.org/tutorials/nbm-crud.html
and had a strange issue for which only by chance I found the work around here on dzone.
My issue:
cannot find symbol
symbol : method actionsGlobalContext()
location: class javax.swing.text.Utilities
result = Utilities.actionsGlobalContext().lookupResult(Customer.class);
Which was worked around by the change:
result = WindowManager.getDefault().findTopComponent("CustomerTopComponent").getLookup().lookupResult(Customer.class);
But my question...
Clearly it looks like I was missing a library dependencey. But when looking all over the internet, no one else had this issue, or spoke about using actionsGlobalContext with a specific dependency.
Is this a resent change that you may be aware of, or does it sound like my configuration may be suspect.
Can you suggest or point me to a resource which would allow me to figure out these types of dependencies on my own. In other words which file located in which directory contains this method.
Also, I have noted a few minor changes needed in the netbean.org tutroial based on my configuration and would be willing to update or provide suggestion if that was appropriate. Is that work done here on dzone or via netbeans.org?
Thanks in Advance
Terry Harple
Mark Green replied on Sat, 2011/07/30 - 8:18pm
Johnson Eyo replied on Wed, 2011/08/24 - 5:48am
Johnson Eyo replied on Tue, 2011/09/13 - 3:50am
my program still refuses to build the customerlibrary to a jar file,i get these errors onh the console window,
init:
deps-clean:
Updating property file: C:\CustomerLibrary\build\built-clean.properties
Deleting directory C:\CustomerLibrary\build
clean:
init:
deps-jar:
Created dir: C:\CustomerLibrary\build
Updating property file: C:\CustomerLibrary\build\built-jar.properties
Created dir: C:\CustomerLibrary\build\classes
Created dir: C:\CustomerLibrary\build\classes\META-INF
Copying 1 file to C:\CustomerLibrary\build\classes\META-INF
Created dir: C:\CustomerLibrary\build\empty
Created dir: C:\CustomerLibrary\build\generated-sources\ap-source-output
Compiling 2 source files to C:\CustomerLibrary\build\classes
Note: Creating non-static metadata factory ...
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.NoSuchMethodError: javax.annotation.processing.RoundEnvironment.getRootElements()Ljava/util/Set;
at org.eclipse.persistence.internal.jpa.modelgen.MetadataMirrorFactory.setEnvironments(MetadataMirrorFactory.java:297)
at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:368)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:634)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:565)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:704)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:913)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:659)
at com.sun.tools.javac.main.Main.compile(Main.java:327)
at com.sun.tools.javac.main.Main.compile(Main.java:253)
at com.sun.tools.javac.main.Main.compile(Main.java:244)
at com.sun.tools.javac.Main.compile(Main.java:69)
at com.sun.tools.javac.Main.main(Main.java:54)
C:\CustomerLibrary\nbproject\build-impl.xml:603: The following error occurred while executing this line:
C:\CustomerLibrary\nbproject\build-impl.xml:245: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 7 seconds)
please help with these, because of this i can continue the rest of the tutorial
http://platform.netbeans.org/tutorials/nbm-crud.html
Carla Brian replied on Sun, 2012/05/06 - 7:32am
Berton Jain replied on Sat, 2012/07/14 - 2:07am
Steve Sdas replied on Tue, 2012/09/25 - 9:06am
Steve Sdas replied on Wed, 2012/09/26 - 2:44pm
Steve Sdas replied on Thu, 2012/10/04 - 5:24am
Steve Sdas replied on Sun, 2012/10/07 - 1:04pm