title: Remove JTextPane's white background without setOpaque() over a translucent JFrame
body: <p>I have a Java code where I implemented a translucent JPanel with an image drawn on it with Graphics 2D. This image is a PNG that includes a white rectangle, 80% opaque, all over the JFrame. Now I need to add a JTextPane to display datas (I set it to use a custom font from the app package BTW), but I can't manage to make it translucent : its white background is opaque (even with the <code>textPane.setOpaque(false);</code> setting) and makes the transparency of my JFrame a bit useless... Wich is not cool.</p>
  
  <p>So I am looking for a way to remove this white background that freaks me out.</p>
  
  <p>I rolled many Google searches but everything I found was a boolean to set the opacity of the JTextPane. I also found that with the Graphics 2D I could create a custom JTextPane and Override its background, but It didn't work... I HAVE already tried all of this.</p>
  
  <pre><code>public class MyWindow extends JFrame {
  
      private static class MyTextPane extends JTextPane {
           public MyTextPane() {
              super();
  
              setText("Hello World");
              setOpaque(false);
              setBackground(new Color(0,0,0,0));
           }
  
           @Override
           protected void paintComponent(Graphics g) {
              g.setColor(new Color(0, 0, 0, 0));
              g.fillRect(0, 0, getWidth(), getHeight());
  
              super.paintComponent(g);
           }
      }
  
      public static void main(String[] args) {
  
           MyTextPane textPane = new MyTextPane();
  
           JPanel panel = new JPanel() {
  
               private static final long serialVersionUID = 1L;
  
               @Override
                           protected void paintComponent(Graphics g) {
                                try {
                  Image img = ImageIO.read(new File("images/bg.png"));
                  g.drawImage(img, 0, 0, this.getWidth(), this.getHeight(), this);
                                } catch (IOException e) {
                  e.printStackTrace();
                }
  
                                if (g instanceof Graphics2D) {
                                  final int R = 240;
                                  final int G = 240;
                                  final int B = 240;
  
                  Paint p =
                      new GradientPaint(0.0f, 0.0f, new Color(R, G, B, 0),
                          0.0f, getHeight(), new Color(R, G, B, 0), true);
                  Graphics2D g2d = (Graphics2D)g;
                  g2d.setPaint(p);
                  g2d.fillRect(0, 0, getWidth(), getHeight());
              }
          }
      };
      panel.add(textPane);
      setContentPane(panel);
  
      }
  </code></pre>
  
  <p>(Made the JFrame translucent with the explanations of Oracle, right here <a href="https://www.google.fr/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;sqi=2&amp;ved=0CDQQFjAA&amp;url=http://docs.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html&amp;ei=k63oUMOkMoa60QW40oGoAw&amp;usg=AFQjCNHIWJC3G-jxGCUQ0jxnfi_j86-xuw&amp;sig2=7aResPqi4kJnY8SQunQEhQ&amp;bvm=bv.1355534169,d.d2k" rel="nofollow">HERE</a>) Thanks!</p>