Swing objects can only be accessed from the Swing thread that runs in closed loop handling repaints, GUI events and so on. When you application starts, it starts in an ordinary thread (not a Swing thread). The lines that look strange to you use SwingUtilities
to execute DrawingPanel constructor and probably more code in the Swing thread.
The code that instantiates the first GUI frame directly from the main thread may also work in practice if it is really the first method ever called (as expected). However it is "fundamentally wrong" approach that may not work later under different machine, if differently called and the like.