Another experiment to see if I've understood anything from my studying.
It's very simple, I've added an AWT component/control (specifically a Choice object to a Frame. It's a pop-up menu by any other name.
Above the pop-up, there's a label. I'm trying to change its font to no success.
* I create Label object called label1: Label label1 = new Label("This is a pop-up")
* I create a Font object called f: Font f = new Font("Times New Roman, Font.BOLD, 18)
* I apply the new font to the label: (in AFrame's constructor) label1,setFont(f)
When displayed the label's font seems to be stuck on Arialor something similar. Changing the point size however does have an effect.
I vaguely recall from over a decade ago that you used to have to mess about with the Java configuration to get fonts to work correctly.
But I never actually wrote an AWT application because it was replaced with Swing in 1998. So I would respectfully suggest that if you are spending time learning AWT, you are wasting that time. The chances of your encountering an AWT application at your future place of work are essentially zero.
posted 3 years ago
Oh well, thank you Paul.
At least I know that my thinking was broadly correct.
Yes, I will look into the configurations thing.
posted 3 years ago
Yes, I really can't wait to move on to Swing or even FX and I would hate others to think I am ignoring their advice.
Slight Asberger's - or bipolar 'light' - Oh God, both ) - call it what you will.
There's a crazy rationale to it all: Swing is derived from AWT and, when I come to it, I might find that Java FX is based on them both so AWT might be a good grounding for the future. I hope I don't turn out like those crazy old anachronisms that can't let go and find myself obsessively trapped in the AWT world.
That would be a waste of time. Chances are you will never need to know how to do that and I've never needed it in the last two decades. It will not help you with Swing of JavaFX. Spend you time learning something that might actually be useful.