I'm trying to learn java and the awt framework from this tutorial: https://www3.ntu.edu.sg/home/ehchua/programming/java/j4a_gui.html, but I have hit a stumbling block: how do you import packages? For instance, here is what I don't want to do:
import java.awt.* //pollutes global namespace and results in hard-to-trace class names
I also don't want to reference the java package every time I want to use one of the awt package's classes:
setLayout(new java.awt.FlowLayout()) //cumbersome and redundant
What I want to do is something like this:
from java import awt
setLayout(new awt.FlowLayout()) //I want to use awt here without saying java.awt
Is something like this possible in java, or does the language just not allow it?
I also don't know where setLayout comes from, but that is beside the point. I assume it is a static method of Frame that is being implicitly called?