Re: Automatically resize font when component size changes?



On Mar 20, 2:44 am, larkm...@xxxxxxx wrote:
Is there a simple way to figure out what the biggest font size is that
can display a given text string on a given size component (JLabel,
etc.)?

Take a look at..
<http://java.sun.com/javase/6/docs/api/java/awt/FontMetrics.html>

Andrew T.

.



Relevant Pages

  • Re: add a String to a JScrollPane
    ... > I have a String which is changing and I want to display it in a JScrollPane. ... With a JLabel you can change the text at any time you want. ... JScrollPane, to cause it to ask the JLabel about its next size. ...
    (comp.lang.java.help)
  • Automatically resize font when component size changes?
    ... can display a given text string on a given size component (JLabel, ... I'm extending it from a JLabel for simplicity. ... JLabels do not change font size when their bounding size changes. ... how big a string formatted as HH:MM:SS will render (maximum height ...
    (comp.lang.java.gui)
  • Re: Cant display UTF-8 encoded text in a JLabel
    ... I got a text string from a UTF-8 encoded file and ... after reading the file I set a String with the text content in order ... to display in a JLabel. ...
    (comp.lang.java.gui)
  • Re: A Simple BMP Converter
    ... "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal ... Private Sub cmdSysInfo_Click ... Open Registry Key ... > color bar in the color display. ...
    (comp.lang.basic.visual.misc)
  • Re: help collecting data.
    ... Dim GetC As String ... the code in the cell that I want the order numbers(info from column C ... "Otto Moehrbach" wrote: ... display them both, seperated by a comma ...
    (microsoft.public.excel.misc)