Recently I came across a stone in the shoe, I was going to comment on a code, but I realized that I was filling sausage by commenting it, because I do not know what the actual use of the code is:
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension d = tk.getScreenSize();
lblResolucao.setText(+d.width +" x " +d.height);
In case it is a Swing code to capture the resolution of the device, but I have no idea the real reason they are there (it's kind of confusing to even explain).
I would like you to explain the first 2 lines DETAILED to me so that I can really understand the code.