Highly recommend you put that tutorial aside for the moment.

Instead of that, do this one instead, which will teach you a lot more:

https://platform.netbeans.org/tutorials/nbm-quick-start.html

Also, definitely get this book:

leanpub.com/nbp4beginners

Thanks,

Gj

On Tue, Jan 23, 2018 at 5:31 AM, Jeff Melton <melma...@yahoo.com.invalid> wrote:
> 1.  I'm new to Netbeans and Desktop App Development, but want to use the
> Netbeans Platform to develop simple Desktop database applications; thus I
> ran through this tutorial for the first time tonight.  I'm using Netbeans
> IDE 8.2, with JDK 1.8.
>
> 2. I'm almost positive this basic question has probably been asked before
> and likely resolved, but I cannot find answers after trying to do so for
> some time.  Your recent migration over to Apache has removed a lot of the
> help/forum archives and history. The link to full source code for the
> tutorial was broken and sent me to a generic Oracle site.  I cannot find a
> solution in StackOverflow or anywhere else, and would appreciate knowing how
> to troubleshoot the basic view step of the tutorial before moving on.
>
> 3. I submitted this email first from an online form, but haven't heard an
> acknowledgement that it was received, so now I'm sending it directly via my
> email.  I apologize if this is therefore submitted twice - just like with
> the broken Oracle links, it's difficult to tell in the transition to Apache
> just how to submit help requests.
>
> Now, for my specific issue:
>
> For the very first view exercise, I tried to follow the tutorial exactly as
> specified using Derby database, and all of the project/code base names
> exactly as provided.  I cannot get the CustomerViewerTopComponent.java
> module to compile as specified after inserting the provided code snippet at
> the end.  Dependencies were registered as specified in both the
> CustomerLibrary and CustomerViewer modules, and the "Fix Imports" command
> was run.  All errors cleared up but one, on the "for (Customer c :
> resultList) {" line.  I went ahead and tried to build, though, and the
> compiler error messages are as follows:
>
>
> ---------------------------------------------------
>
> C:\Users\Jeff\Documents\NetBeansProjects\DBManager\CustomerViewer\src\org\shop\viewer\CustomerViewerTopComponent.java:113:
> error: illegal start of type
> for (Customer c : resultList) {
> C:\Users\Jeff\Documents\NetBeansProjects\DBManager\CustomerViewer\src\org\shop\viewer\CustomerViewerTopComponent.java:113:
> error: ')' expected
> for (Customer c : resultList) {
> C:\Users\Jeff\Documents\NetBeansProjects\DBManager\CustomerViewer\src\org\shop\viewer\CustomerViewerTopComponent.java:113:
> error: <identifier> expected
> for (Customer c : resultList) {
> 3 errors
> 1 warning
> C:\Program Files\NetBeans 8.2\harness\suite.xml:187: The following error
> occurred while executing this line:
> C:\Program Files\NetBeans 8.2\harness\common.xml:225: Compile failed; see
> the compiler error output for details.
> BUILD FAILED (total time: 11 seconds)
>
> ----------------------------------------------------
>
>
> For some reason, the compiler doesn't seem to be recognizing "resultList"
> from its declaration in the line above: "  List<Customer> resultList =
> query.getResultList();" As far as the syntax highlighting, resultList
> displays in green color on the "List<Customer>..." line but displays in
> black italics on the following "for (Customer c : resultList) {" line.  And
> this "for" line is underlined red as well.
>
> I thought I inserted the provided code snippet in the correct spot.  Here is
> a larger context of where I actually pasted it in the source code (after the
> readProperties method):
>
>
> ---------------------------------------
>     void readProperties(java.util.Properties p) {
>         String version = p.getProperty("version");
>         // TODO read your settings according to their version
>     }
>
>   EntityManager entityManager =
> Persistence.createEntityManagerFactory("CustomerLibraryPU").createEntityManager();
>   Query query = entityManager.createNamedQuery("Customer.findAll");
>   List<Customer> resultList = query.getResultList();
>   for (Customer c : resultList) {
>      jTextArea1.append(c.getName() + " (" + c.getCity() + ")" + "\n");
>   }
> }
>
> <END OF FILE>
> -----------------------------------------
>
> Any assistance provided would be greatly appreciated!
>
>
> Thanks,
> Jeff
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to