File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT / JFace and the fly likes weirdness with fonts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "weirdness with fonts" Watch "weirdness with fonts" New topic
Author

weirdness with fonts

zoe goddard
Ranch Hand

Joined: Dec 12, 2000
Posts: 74
I've created a dialog that acts as a font chooser. It seems to work most of the time. The font style (bold, italic, etc) doesn't always update the text in the textfield (I also tried label) until I modify the size of the font. I even look at the font to see if it is set right (it is), and I've tried changing the text (try to make it use the current font - it doesn't).
For example it always seems to work for dialog, but never works for complex.
I have no idea why this is happening, let alone how to fix it.
Any ideas?
zoe goddard
Ranch Hand

Joined: Dec 12, 2000
Posts: 74
I read somewhere that the graphics context uses the current font to draw with. I was wondering if this behavior could be due to this. Maybe the label's graphic context's font isn't always being updated with the latest value. If this is true then all I would have to do is override the paint.
Does this sound reasonable?
 
 
subject: weirdness with fonts
 
Threads others viewed
Servlet response.setContentType()??
Setting focus on JOptionPane text field
Can't get Graphics.setFont() to work
font family of empty DefaultStyledDocument
How can I change the font of JOptionPane?
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture