Trying to get a java project together from .java source files ?

Thread Starter

AnalogSwitch1986

Joined Nov 15, 2017
7
Hi there, I have had trouble trying to compile a java applet from a bunch of .java files.

This is a project which I downloaded from the web, it's the falstad circuit simulator. He gives the src files as a zip containing only .java files, and I am using netbeans. I have no idea how to put this together so I can see the forms inside the source and finally compile everything.

How can I do this? I have attached the .zip with the source for you to have a look.
 

Attachments

xox

Joined Sep 8, 2017
936
It won't work right out of the box like that, unfortunately. Here's what you'll need to do to get it working:
  • Unpack src.zip.
  • Launch the Netbeans IDE.
  • Go to "File"->"New Project" and under "Categories" select "Java", then "Java Project with Existing Sources" from the "Projects" subcategory. Click "Next".
  • Fill out the "Name and Location" fields for your new project (or just use the default). Click "Next".
  • Under "Source Package Folders" click "Add Folder". Navigate to and select the folder containing the source code. Click "Finish".
  • Clone the simulator's github repository. A direct link to a generated zip file can also be found here. You won't need all of the files (many are tied to Google's GWT framework and won't work in straight Java anyway). Drill down to "src"->"com"->"lushprojects"->"circuitjs"->"public" and copy all of the contents of that folder (namely "setuplist.txt" and the folder "circuits") directly into the top-level directory of your Netbeans project.
  • From the Netbeans IDE, open the file "CirSim.java" by expanding the "Files" tab. That source file has some UTF-encoding errors than need to be fixed. Go to line 874 and change "J�rgen Kl�tzer" to "Jorgen Klotzer" (don't delete the entire comment - you may need it one day). Click the "Build Project" icon, then the green "Run" icon. At this point Netbeans will ask you if you'd like to set the main class to "Circuit". Click "OK".
If all goes well, you should be seeing something like this:

  • Screenshot from 2017-11-15 03-55-15.png
 
Last edited:
Top