Re: Make font size to fit screen
From: John McGrath (ng_at_jpmcgrath.net)
Date: 03/04/05
- Previous message: SPG: "Re: Make font size to fit screen"
- In reply to: SPG: "Make font size to fit screen"
- Next in thread: SPG: "Re: Make font size to fit screen"
- Reply: SPG: "Re: Make font size to fit screen"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 04 Mar 2005 02:06:26 GMT
On 3/3/2005 at 12:08:48 PM, SPG wrote:
> What I need to do is when the user resizes the applet, Simply resize the
> fonts so that the screen is filled to its max.
>
> I thought about looping on every paint call, simlpy increasing the
> fontsize then checking the font metrics, but that seems a bit
> heavyweight...
I don't think you want to compute the font size in the paint() call.
Instead, use a ComponentListener to listen for componentResized() events,
compute all of the metrics needed for painting, and save the results.
Then, use the saved results in your paint() method.
Chances are that your UI will be repainted *many* more times than it is
resized. Why recompute the metrics on every repaint?
-- Regards, John McGrath
- Previous message: SPG: "Re: Make font size to fit screen"
- In reply to: SPG: "Make font size to fit screen"
- Next in thread: SPG: "Re: Make font size to fit screen"
- Reply: SPG: "Re: Make font size to fit screen"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|