As Rusty mentioned you need to make the Frame visible using setVisible(true) not false. Your code won't work though, it's going to paint the rectangles once. As soon as the frame repaints the rectangles will be gone. You need to move your rectangle painting code to paint() method of the frame or to a widget which you add to the frame.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com