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 4 of 4

Thread: changed packages, now it will not run:

  1. #1
    Member
    Join Date
    Apr 2014
    Posts
    219
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default changed packages, now it will not run:

    I did have all my classes in one package and it just look ugly. So I made a package for each button using MVC design pattern and now it much easier to understand. However now it will not run. I simply changed the package name for each button and when the red line came under the package it gave me the option to add this class to the new package name. All errors were gone and now I am getting this error:

    Error: Could not find or load main class org.Home.DataBase.StartUpMenuController

    But there is a main method in this class but the package name is actually (package mainMenu.Home.DataBase the old name was org.Home.DataBase the class name is StartUpMenuController (this class has the main method)..

    How can I fix this ?

    --- Update ---

    Never mind got it working, not sure what I did though.... HUmmmm

    --- Update ---

    How do you mark [SOLVED] on this thing?


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: changed packages, now it will not run:

    The Solved option is in the "Thread Tools" menu item at the top of the topic.

    Having each button of the same interface in a different package sounds unnecessarily complicated. They say beauty is in the eye of the beholder, and I don't think your eye is trained to determine beauty in Java, but you'll get there with exercises like this one.

  3. #3
    Member
    Join Date
    Apr 2014
    Posts
    219
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default Re: changed packages, now it will not run:

    Please do explain here. I have been taught modularity is a key concept of Java. I am making a different database for my house, so that I know where everything is, storing pictures, their location etc... I have a generate reports button which will make an excel sheet of everything or just the items asked for, a add item button and find item button.

    Each button will open a whole new screen from the main menu. This is all done in swing and mySQL.

    What kind of design would you have chosen? I am using MVC and each button is in a different package at the moment.

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: changed packages, now it will not run:

    Start by reading this Oracle trail on packages and then let us know if you have questions.

    I hope you get from the trail that packages are a tool to help the programmer organize their code. The programmer should gain some benefit from being organized. Having packages (being "organized") without a plan and purpose is likely to create more hardship for the programmer than benefit and convenience.

Similar Threads

  1. Java Packages creat and run in Eclipse
    By nilesh.surwade@gmail.com in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 29th, 2014, 03:23 AM
  2. how to know if cell was changed in tableviewer
    By yosba221 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 23rd, 2014, 05:02 PM
  3. Replies: 2
    Last Post: November 18th, 2012, 02:09 PM
  4. My path is changed...
    By Oryan Dallal in forum Member Introductions
    Replies: 1
    Last Post: July 24th, 2011, 07:16 AM
  5. What must be changed in the following code
    By kulk_dm in forum Member Introductions
    Replies: 2
    Last Post: February 3rd, 2011, 02:34 AM