Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GUI Netbeans Swing: How to get this code into GUI form?

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, so I fooled around and made this out of examples I found and I put my revised code from last week with it. How do I get my GUI code into a GUI format? I wrote this put it will not make a GUI image.



I get errors:

debug:
java.lang.NoClassDefFoundError: ofelia_inventory_4/Ofelia_Inventory_4 (wrong name: Ofelia_Inventory_4/Ofelia_Inventory_4)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Exception in thread "main" Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

When I debug with my program.


Here's the rest of the program if you need it. I'm sorry to do this, I know you guys get tired of all this long code:







 
Os Stewart
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On another note, I created GUI not in a Swing GUI Form, every time I try to implement code into it I get lost. Any suggestions? I just need a simple GUI that will run each item one after the other.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It probably doesn't have anything to do with Swing. Looks like a wrong name of the package or directory.

I'd suggest renaming the package to not contain upper case letters at all and also remove underscores (it is probably legal, but very usunual). So your package name could be ofeliainventory4. The rename the directory containing your class to ofeliainventory4 as well.

For your main class I'd also suggest to use a name different from package name, more than in just letter case. You can rename your class just to Main, or perhaps OfeliaMain if you must. The reason is that at this time, when you see Ofelia_Inventory_4 in some error message, it isn't immediately clear whether the error pertains to the package or to the class.

Then rebuild your entire project and try to run it again.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic