Original question:http://forums.sun.com/thread.jspa?threadID=5323307

So I would like to include a bean into the same project (as a separated library of course) that uses it, so the project would be self containing, and the bean's code would stay in syncron with the program's one, even if I move it to another computer. (And of course I would get rid of the project switching for testing a visual bean.) I'm using NetBeans, but I'm open for new tools only to do this.
I already know that this is not the way a general bean should work, and that the IDE is using the code (I mean the last compiled version of it) I would be editing, but I still would like to do this.
Also it would be great if I could make the IDE know somehow when loading my project on another computer to automatically install the included components into the palette. (Of course, if it wouldn't be visible before installing by hand, but it still could be deserialized, and the program could run, it would be enough for me by now.)
I'm just moving to java, so I would like to know how this kind of thing works here. Every tutorial I find about beans makes a separated project even for testing...

I wonder if sby will answer it there, so here you come! :)

Just for you:
My purpose would be to 1st eleminate all woodcutting hadwork when I'm customizing a visual component for my program (yes, it's not the traditional component development aproach) and moving it betwen my comp and laptop while editing each code, which is a pain now even withuout moving, and 2nd, to get rid of confusion when I send the code (or... don't laugh please: trying to use it myself later), and "it just won't compile, you've missed something", "no it's there what you think I've missed", "then it would compile I guess"...

Thanks for the help!

WooHoo! NetBeans can do it now!

If you have the source file in a NetBeans project...
...you can even use the component without installing to palette:
Select the java file of the component in the project explorer and invoke Copy (Ctrl-C).
Open the GUI form where you want to add the component to. The form can be in the same or in another project.
Select the desired target container in the form (either in the designer area or in Inspector).
Invoke Paste (Ctrl-V).
Adjust the component's position/size via mouse as needed.

Notice: You must keep the default no argument constructor public for this to work!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.