Jump to content

Determine TextField width at design time


2005 IR Help

Recommended Posts

By: John Augusto Charnet - jcharnet

Determine TextField width at design time

2004-06-17 11:14

Hello,

I'm generating some dynamic reports. I'd like to know if there is a way (using Jasper, or even iText API) to determine the exact width of a text so that at design time I could set the width of my text ?

I know that java.awt.Graphic has a getFontMetrics and with this class I can get the width in pixels of a determined text.

Is there something similar ?

Thanks a lot.

Sincerely,

John.

Link to comment
Share on other sites

  • 2 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I too am in need of this information and also the height to overcome a couple of issues.

 

First the width of the field does not display correctly between widows and linux so I need to make sure that the text is not going to get truncated on linux. Second we are developing a report that the user will be able to set thier own font preference for and therefore I need to make sure the data will actually display regardless of thier choice.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...