Search code examples
javaswingbackgroundpaintcomponent

Better way to paint a JComponent in java swing


We can paint the background of a Jcomponent in swing and can also place background image. I want to know which is the better way to minimize the memory usage? Can anyone help?


Solution

  • In case you are repainting the area again and again ,then its always better to only repaint the required portion instead of painting entire region.

    Filthy Rich Clients by RomainGuy and Chet Hasse is an excellent learning source for swing painting techniques