Home » Category » Java Miscellaneous

Java Miscellaneous: Help how to add backgroud in text2dtext.java?

300| Mon, 24 Sep 2007 05:51:00 GMT| jojoa| Comments (4)
is there anyone know how to add the texture as backgroud , and then have the 3d word in as well . Thank you for ur help!!!

Keywords & Tags: add, backgroud, text2dtext.java, java

URL: http://java.itags.org/java-tech/99607/
 
«« Prev - Next »» 4 helpful answers below.
Redefine the paintComponent method of the component : you set the texture with setPaint of Graphics and then you draw the String with drawString method of Graphics

antoine_lemoinea | Mon, 16 Jul 2007 02:00:00 GMT |

i am not sure what you need. Background in 3d scene? if so, see examples in j3d sdkAnd if you need word (text?), see examples again :-D

thidneya | Mon, 16 Jul 2007 02:00:00 GMT |

I want to make a texture image as background, and add text on it , The text can be moved by mouse to anywhere in the background . now , I only made the image as background , and some text on it ,but the text is too big. I typed 搘elcome to garden design? when I run it , I only can see one letter 憌?. I am wondering do u have some idea to make the text smaller . I already changed the size to 1 , but i still can not see the whole words i typed . The code like below

--

Font3D f3d = new Font3D(new Font("Arial",Font.PLAIN,1),extrusion0);

--

I am tried to use set Scale. But it is not work as well. The code like below .

TransformGroup objScale = new TransformGroup();

Transform3D t3d = new Transform3D();

t3d.setScale(0.2);

objScale.setTransform(t3d);

objRoot.addChild(objScale);

I am wondering how I can change the text to the different location on the backgroud, not only in the center.

Thank you so much for u help ^-^

jojoa | Mon, 16 Jul 2007 02:01:00 GMT |

When are you painting the text ?What is objRoot ?

antoine_lemoinea | Mon, 16 Jul 2007 02:01:00 GMT |

Java Miscellaneous Hot Answers

Java Miscellaneous New questions

Java Miscellaneous Related Categories