I want to create a custom JComponent (specifically a custom JToggleButton) that has a custom appearance. What i want to do is simply override the default painting of the component and draw something of my own (an image for instance)
This is NOT a question on how to do that (I am fairly proficient with Java2D). What i want to ask is what steps must i take to ensure that my component has the size i desire it to have?
The tests i have done so far have been problematic. I draw an image of lets say 200*100 pixels and the layout managers display only a part of my component. I tried setSize, setPrefferedSize, setMinimumSize and none of them worked.