Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Java Project

  1. #1
    Junior Member
    Join Date
    Jan 2025
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java Project

    Java project

    Hello everyone! I’m a computer science student, and I have to do a project in the Java programming language, which involves creating a software application for a natural products store, an application that must keep track of medicinal plants. For each type of medicinal plant available, the application displays the name, the quantity available and the price. When a customer comes to the store, the seller will choose a medicinal plant from the list, enter the quantity requested by the customer and press the "BUY" button. After pressing the button, the list of medicinal plants is updated (the available quantity of the purchased product). Also, the seller can introduce new types of medicinal plants. For a new type, its name, quantity and price will be entered. After pressing the add button, the list of medicinal plants is updated. When the application is started, the list of available medicinal plants is read from a text file (one line for each plant).After a product is sold, its name and the quantity sold are saved in the “SoldPlants.txt” file.
    Also, it is necessary to highlight an application architecture on 3 levels:
    1. interface (presentation level) - graphical interface;
    2. application logic (logical level) - problem field; 3. Data persistence (data level) - repository.
    The interface must include the fundamentals of graphics in Java: positioning management, event handling, listener interfaces and internal classes for event management. At the same time, the interfaces must include menus, control menus, accelerators, etc.
    Access to the application will be based on username and password (so I also need a Login window included in the project).

    I've already tried to do the project with the help of AI, but I didn't understand anything and the big problem is that I have an error that I can't get rid of. I work with IntellijIDEA, and I have formed 5 classes: Medicinal Plant, StoreFileManager, StoreApp, MainClass, LoginWindow and I have also created the “Plants.txt” file (in MainClass I wrote the code to create it), and the “SoldPlants.txt” file. Also in MainClass I called the login window. Now comes the problem: when I run MainClass, I get the following error:

    java: cannot find symbol
    symbol: method startStoreApp()
    location: class MainClass.

    The line of code it refers to sounds something like this:

    new MainClass().startStoreApp();

    This error appears from the LoginWindow, that is, when I run MainClass it sends me to the LoginWindow and shows me this error...

    I'll tell you seriously, I'm not good at programming at all, I'm a beginner and I can't finish any project on my own. Here in Romania, teachers don't help you with anything to understand how to program in a practical way, they just give homeworks and that's it. AI doesn't help much either, it seems that there are still errors. All the code so far is copied from there. So I don't know what each line means and why certain sentences are written like that.
    My big request is, if there is someone who is good at programming in Java, to help me solve this project, to tell me how I should do it from start to finish thoroughly, without that or any error. If possible, explain to me why the error occurred and how to get rid of it, I would be really grateful!🙏🏻

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,167
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java Project

    java: cannot find symbol
    symbol: method startStoreApp()
    location: class MainClass.
    Check that the class MainClass has a method named startStoreApp(). Make sure the spelling matches. Java is case sensitive.

    This is an unusual way to call a class's method:
    new MainClass().startStoreApp();
    Normally instances of a class are created and then its methods called:
          MainClass mainCls = new MainClass();    // Create instance
          mainCls.startStoreApp();                // call a method
    The second way keeps the instance of the class available so it can keep values in its variables and so other methods of the class can be called and use those values.
    If the program does not need to keep an instance of the class for further usage, then the methods could be static and they would be called this way:
          MainClass.startStoreApp();     // call static method
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Java Admin and user level privileged java project
    By pranali123 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: August 14th, 2018, 05:48 AM
  2. How to return a string from java project into android project
    By AmitShef in forum What's Wrong With My Code?
    Replies: 4
    Last Post: June 27th, 2014, 08:33 AM
  3. Replies: 1
    Last Post: April 6th, 2014, 05:16 PM
  4. Java School Project Help; Project #2, In Danger of Failing.....
    By john++ in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 2nd, 2014, 02:35 AM
  5. Replies: 2
    Last Post: August 1st, 2010, 06:29 AM