While I'm not sure how to change it at runtime, you can set at the command line your Dock icon using the -Xdock:icon
option, like:
>java -Xdock:icon=/path/myIcon.png myApp
This article has lots of useful little info about bringing java apps to Mac, and you may be interested looking at the utilities and tools for Mac listed here, as well as deployment options listed here (the last link is especially useful if you want to go down the Java Webstart route).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…