A small working example of a JFrame. Feel free to copy/modify/use this code.