Is there any program that lets you draw basic shapes on the screen and then gives you the coresponding java2D code to draw those inside a program. I'm planning on doing my current game using only java 2D drawing code as opposed to images but I don't know if it's worth it if I have to spend ages writing+testing all the drawing code.
If no existing applications do what you want, you might consider writing a simple 'viewer' rather than a full-blown 'editor'.
For example, you could have a simple ASCII text file that describe the shapes you want to display (e.g., "C 0 0 10" for a circle at (0,0) with radius 10), and edit that file in Notepad (or whatever). The 'viewer' application would read in the text file and display the shapes on a canvas (using the same code that your game would use). If the shapes aren't quite right, then you use Notepad to make changes, and hit the 'reload' button on the viewer to see what they look like.
Editing the shapes in this way wouldn't be as nice as clicking and dragging on a proper editor, but unless you want to draw a lot of shapes then you're probably saving a lot of development time overall.
Just a suggestion.
P.S. Since we're talking about Java2D shapes here, you could probably define your drawings directly as Java source code, rather than inventing an ASCII text file format. You could edit a source file as usual, compile it into a class file, and have the viewer reload and execute that class file.