title: XOR Painting issue in java
body: <p>I have a problem with java Xor method:</p>
  
  <pre><code>public class Okno extends JFrame {
  
  public static void main(String[] args) {
      Okno okno = new Okno();
  }
  
  
  Window()
  {
      this.setSize(300,300);
      this.setDefaultCloseOperation(EXIT_ON_CLOSE);
      JButton button= new JButton("Circle");
      button.addActionListener(
      new ActionListener() {
  
          @Override
          public void actionPerformed(ActionEvent e) {
              Graphics2D g = (Graphics2D)Window.this.getGraphics();
              g.setXORMode(Color.red);
              g.setStroke(new BasicStroke(10));
              g.drawOval(100, 100, 100, 100);
          }
      });
  
      this.add("South",button);
      this.setVisible(true);
  }
  </code></pre>
  
  <p>It paints circle after second click on button. On Graphic from Image it works fine...</p>