title: How to set a 3D border for a JDialog with rounded corners?
body: <p>I could add a rounded corner border to my JDialog as in <a href="https://stackoverflow.com/questions/3056089/how-to-create-a-rounded-title-border-in-java-swing">How to create a rounded title border in Java Swing</a>. But it is still one color. I want to make the border looks like 3D.  </p>
  
  <p>Here is how I tried.   </p>
  
  <pre><code>Graphics2D g2d = (Graphics2D) g;
          Color c1 = getBackground();
          Color c2 = color1.darker();
          int w = getWidth();
          int h = getHeight();
  
        GradientPaint gp = new GradientPaint(
                  0, 0, c1,
                  0, h, c2);
  
          g2d.setPaint(gp);
          g2d.fill3DRect(0,0, w, h,true);
  </code></pre>
  
  <p>Then, no 3D look, but the border has been widen more with its border color.<br>
  How can I achieve this? </p>
  
  <p>Any sample code or links will be highly appreciated.</p>