code: protected void paint (Graphics2D gfx, Rectangle[] dirty)
      {
          int dcount = dirty.length;
  
          for (int ii = 0; ii < dcount; ii++) {
              Rectangle clip = dirty[ii];
              // sanity-check the dirty rectangle
              if (clip == null) {
                  log.warning("Found null dirty rect painting media panel?!", new Exception());
                  continue;
              }
  
              // constrain this dirty region to the bounds of the component
              constrainToBounds(clip);
  
              // ignore rectangles that were reduced to nothingness
              if (clip.width == 0 || clip.height == 0) {
                  continue;
              }
  
              // clip to this dirty region
              clipToDirtyRegion(gfx, clip);
  
              // paint the region
              paintDirtyRect(gfx, clip);
          }
      }
docs: Performs the actual painting of the media panel. Derived methods can override this method if
  they wish to perform pre- and/or post-paint activities or if they wish to provide their own
  painting mechanism entirely.