I have an applet that queries a database and then returns a String and the applet draws that string. My only problem is how do I set up the applet so the string is only displayed within the applet? Right now have of it is, and the other have extends beyond the applet? I know this maybe simple but I've tried a few things and I am stumped. Thanks.
I don't know if I understood your problem correctly. I had a similar requirement, where I had to display a whole paragraph. You could substring the database string, and extract say, 50 characters into an array. and display each array element in a separate line. So, each line would display 50 characters. Or if your string is shorter, you could change the font. I hope this solves your problem?
Hi Sean, I am not really sure about your problem. But you need to work with the positioning of the string and the string width. To get a strings width you should use the FontMetrics.stringWidth method. Regards, Manfred.
Lasagna is spaghetti flvored cake. Just like this tiny ad: