Window/Frame true size

I am fairly new to game programming in java and actually quite new to java in general. However, I am keen on making a game as my learning process for the language. I was browsing a site that listed common problems that arise when programming games in Java and one such problem was that when creating a JFrame of dimension width x height, the entire frame (title bar & borders included) takes up the space of width x height, rather than the actually drawable area being of that size. An easy solution, they list, is to insert a Canvas object of the size you truly want. However, after over an hour of fiddling around there doesn’t seem anything easy about this to me :-[.

Basically, what I’ve been trying, is to create my frame, then I create a canvas and change the canvas size with .setSize(width,height). After this I try inserting it into my frame, but my frame doesn’t appear to change in size from this.

I have found the answer in pack()

what is your question?