- This topic has 4 replies, 2 voices, and was last updated 16 years, 8 months ago by
Riyad Kalla.
-
AuthorPosts
-
Douglas M HurstParticipant… for Matisse/Swing.
Do you think this is worth adding to the Preferences->Matisse dialog? The reason I say this is because, at least in my experience, Tahoma does not present itself at runtime the way it does in the designer. When I switch to Arial, it does present itself properly. In my case, I would like for the default font to be Arial. In fact, If I place a label on a form, then change that font to Tahoma in the properties editor, it then appears the same at runtime.
I have screen dumps that depict what I see as a problem, but I don’t see any way to attach them to this post.
I’ll be happy to send them along if you would like to see them.
It’s a real pain to have to change the font (especially of every label) you place on a form… just to get it to appear at runtime the same as it does at design time.
Riyad KallaMemberThis is actually a feature, but presented in a slightly odd way that we have an open enhancement on.
The default font is determined by the LNF used. By default the Matisse designer picks up the platform LNF, so on Windows, that’s the Windows LNF. The problem is we don’t have a nice easy way for *you* to set the LNF in your code besides writing the code yourself. So you design in the platform LNF and when you run it, unless set otherwise, you get the default Metal/Ocean/Nimbus LNF which is where the confusion is coming from.
The fix is easy enough, adding UIManager.setLookAndFeel(UIManager.getSystemLookAndFeel()); (or something approximately like that) to the first line of your code, then the design and runtime will look the same.
Douglas M HurstParticipantUIManager.setLookAndFeel(UIManager.getSystemLookAndFeel());
I tried putting this in my main and also in the constructor
getSystemLookAndFeel()
IS NOT a member of UIManager
getLookandFeel()
IS a member, but it didn’t make any difference
UIManager.setLookAndFeel(UIManager.getLookAndFeel());
Didn’t seem to be effective. It seems to me, this would simply setLookAndFeel to it’s current value.
Douglas M HurstParticipantAh!!!!!
getSystemLookAndFeelClassName()
did the trick.
Riyad KallaMemberGood deal, sorry about the snaffu, was going from memory.
-
AuthorPosts