Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I tried to print two images back-to-back using a JPanel containing two JLabel instances read using HTML, but I get a gap between them. How can I avoid this?

0
Posted

I tried to print two images back-to-back using a JPanel containing two JLabel instances read using HTML, but I get a gap between them. How can I avoid this?

0

This appears to be an inherent problem when using HTML to load an image into a JLabel. There are three approaches that won’t introduce a gap. One approach is to use ImageIcon rather than HTML to get your image into the JLabel instances (see Q10).

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123