Is it possible? I want my components to look separated--properly so, with distinguishing border colours, not just with hgaps and vgaps. Is there a way to emulate it? I tried setting a panel background to black, then using hgaps and vgaps in hopes that the black would show through the gaps. Didn't work since the gaps weren't transparent spaces like I first thought.

Any ideas? I would prefer not to stray away from using GridLayout instead something like JTable.

Try something like this

component.setBorder(BorderFactory.createLineBorder(Color.black, 5));

5 is this size of the gap between components.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.