What graphics API are you using?

If you are talking about the way you draw things with Swing then I think it is impossible. Just draw 2 rectangles next to each other.