You can simply override paintComponent(Graphics g){}
for ff and draw your within that method.
i.e.
JPanel ff = new JPanel(){
public void paintComponent(Graphics g){
// Draw what you want to appear on your JPanel here.
// g.drawLine(blah blah blah), etc.
}
};
In which case you have no need for this...
ff.add(new JComponent() {
...
});
You don't need this generic component unless you want to implement the custom component as suggest in the link you provided. In the case that you do want to create such a custom component, then you don't need ff
, since a JFrame is already a container that can hold your component.