When creating a GUI in Java with Swing, how should more complex "elements" be created? As an example, consider:

This can be done using ~ 10 images depending on the current page or status. I am also sure that it would be possible to do this programmatically, however, given my past experience with Swing, I am also sure that this will be a lot of code for something relatively simple . Especially considering this can be done in CSS with max ~ 40 lines of code.
In such a situation, is there an alternative approach for creating this “element”? If not; which is preferable: images or swing?
source
share