Guys,
Here is another query, I am posting too many strange things today ..
well actually I am working on this custom button field with a small image on left side along with a string following it. What I am trying to do is to create a button with an image and user provided string.
Not the issue I am facing is that, here I have to use Graphics class FillRectangle method to create a rectangle that can accommodate both my image and the string provided. I am able to get the width of the image using getWidth method but for string I m not sure how to get the width in pixels as the String.length() method gives us the number of characters in the string.
I hope you understand the scenario, what I need is to have something that can give me the length of the string in pixels, so that I can draw that big rectangle to accommodate both my image and the string. Right now I am putting it hard coded but I want it to be custom enough to expand or shrink depending upon the given string.
Any idea how we can get that width in pixel for a string. I hope my English is able to make u understand the things.