Is there a way to tack a variable onto the end of a print.drawString so it would show up like
Text: <variable>
Or:

page.drawString ("Text: " object1, x, y);

Where object1 is the variable. I tried doing that, but i get an error ")" Expected on that line, i suspect that it is because anything that is expected in that first slot is expected inside of quotes.

Recommended Answers

All 2 Replies

Where object1 is the variable. I tried doing that, but i get an error ")" Expected on that line, i suspect that it is because anything that is expected in that first slot is expected inside of quotes.

Incorrect. Anything in that first argument has to amount to a String, just like the javadoc says for the drawString method. So you could put "I'm a String!" + object.toString() in that slot if you wanted to. Or you could even put "I'm a String!" + object, I think.

php in used to cms project?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.