how Can we do 2D animation using java.?

hello friends,I am new to java 2d and swings application.I have great Interests in java Desktop Application and java games. I see many upcoming desktop apps & mobile/desktop games in java . which indeed i think is a new career option. what say?
[276 byte] By [Avinash.Ka] at [2007-11-27 8:15:52]
# 1
You probably might want to look at timing framework (https://timingframework.dev.java.net) that created to help developers with writing animated stuff. Also, here is one more project that deals with animation (actually, it's based on timing framework) https://mediajuggler.dev.java.net
AlexeyUshakova at 2007-7-12 20:00:43 > top of Java-index,Security,Cryptography...
# 2
hey Thanks, Alexey Ushakov
Avinash.Ka at 2007-7-12 20:00:43 > top of Java-index,Security,Cryptography...
# 3
i have an input image and input text from one page.i want to create one image with the both.can i achieve it through java and jsp
chaithubtecha at 2007-7-12 20:00:43 > top of Java-index,Security,Cryptography...
# 4

Yes, you can. I'm not going to post code, but here's a simple rundown of the steps:

* Write a servlet, which outputs an image. (see BufferedImage)

* In the servlet, use Image img = (Image) request.getSession().getAttribute("theImage"); to obtain the image object (which you need to pass to the servlet)

* use the same method to obtain the text: String myText = (String) request.getSession().getAttribute("theText");

* draw the image to the buffered image using g2d.drawImage(img, 0, 0, null); where g2d is the graphics context of the buffered image

* draw the text in the same way.

* Then, use

OutputStream out = response.getOutputStream();

response.setContentType("image/jpg");

try {

ImageIO.write(buf, "jpg", out);

} catch(IOException ioe) {

//handle it!

}

out.close();

That should sort you out :)

mokopaa at 2007-7-12 20:00:43 > top of Java-index,Security,Cryptography...