If you don't care about the ties to AWT (has implications on mainframes and unix boxes), you can use the AWT FontMetrics class. It doesn't *exactly* match the Java versions of the fonts but you can probably get "good enough for government work" as the phrase goes.
We have an RFE open on this: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6842 -andy On 7/21/03 3:33 AM, "hotmail" <[EMAIL PROTECTED]> wrote: > Hi,everyone: > How can I set the column length to the content length. > I have used this method: > String content = "blah,blah,balh"; > int length = content.getBytes().lenght; > sheet.setColumnWidth((short)1, (short)length*256); > > But, I think this is very boring. Is there a function, which I can call and it > will set the perfect column length to equal to the most widest content length. > > Regards > > Alan -- Andrew C. Oliver http://www.superlinksoftware.com/poi.jsp Custom enhancements and Commercial Implementation for Jakarta POI http://jakarta.apache.org/poi For Java and Excel, Got POI? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
