0
Recently I came across a stone in the shoe, I was going to comment on a code, but I realized I was filling sausage when commenting on it, because I do not know what is the actual use of the code below:
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension d = tk.getScreenSize();
lblResolucao.setText(+d.width +" x " +d.height);
In this case it’s a Swing code to capture the device resolution, but I have no idea why they’re there (it’s confusing even to explain).
I would like you to explain the first 2 lines IN DETAIL so that I can really understand the code.
AWT is not a class.
– user28595
Okay. I’ll fix it. This error was a mistaken and mistaken translation of the excerpt "This class is the Abstract superclass of all current implementations of the Abstract Window Toolkit. Subclasses of the Toolkit class are used to bind the Various Components to particular Native Toolkit implementations. " of the Toolkit class documentation.
– Antonio Alexandre
Another thing, what with height encapsula? It became very vague.
– user28595
Fixed. Encapsulates screen width and height values.
– Antonio Alexandre