Here is the code. Any help would be highly appreciated!

Issue: repaint() doesn't work. everything will be re-painted only if i stretch the window, not by a command repaint().

Image: JPanel repaint() -  causes very weird behavior-q8tn.png


Java Code:
package vittu;
 
import javax.swing.*;
import java.awt.*;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseMotionListener;
import java.awt.event.MouseMotionAdapter;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;

import java.awt.geom.AffineTransform;


import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import java.util.logging.Level;
import java.util.logging.Logger;

import javax.imageio.ImageIO;


import java.awt.geom.Ellipse2D;


class superBall extends JPanel {
	
	private int x = 0;
	private int y = 0;
	private int width = 40;
	private int height = 40;
	
	private int dropHeight = 0;
	
	private int angle = 1;
	
	private boolean clearX = false;

	public void setAngle(int newAngle) { angle = newAngle; reDraw(); }
	public int getAngle() { return angle; }
	
	public void setX(int newX) { x = newX; }
	public void setY(int newY) { y = newY; }
	public int getX() { return x; }
	public int getY() { return y; }
	
	public void setWidth(int newWidth) { width = newWidth; }
	public void setHeight(int newHeight) { height = newHeight; }
	public int getWidth() { return width; }
	public int getHeight() { return height; }
	
	
	public void setDropHeight(int newHeight) { dropHeight = newHeight; }
	public int getDropHeight() { return dropHeight; }
 	
 	private BufferedImage imgBuffer_test;
 	
    private TexturePaint texture_test;



    public superBall() {

		super();
        loadImages();
        
    }
    
    
    private void reDraw() {
    	
			//comment to see working version. 
			//Stretch window size at the same time to see it working (repainting correctly).
    		repaint();

    }


 	private void loadImages() {

        try {
            
            //Ladataan puskuroituun kuvaan tiedosto
            imgBuffer_test = ImageIO.read(new File("superball.png"));
            
        } catch (IOException ex) {

            Logger.getLogger(superBall.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void doDrawing(Graphics g) {

        Graphics2D g2d = (Graphics2D) g;
        //tekstuurin määrittely
        texture_test = new TexturePaint(imgBuffer_test, new Rectangle(0, 0, this.width, this.height));
		//tämän halutaan näkyvän
		g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
        //apply
	    g2d.setPaint(texture_test);
		//kuvan rullaus (epäkesko että nähdään piirtyykö alle jäävä alue, koska objekti on pyöreä
        g2d.rotate(Math.toRadians(this.angle), 20 ,50);
	    //piirretään ympyrän edelläm. asetuksilla
	    g2d.fillOval(1, 1, this.width -2, this.height-2);
      	//turhat pois
		g2d.dispose();
		
   } 

   	@Override
	public void paintComponent(Graphics g) {

		//oma instanssi
        Graphics2D g2d = (Graphics2D) g;
		//tausta veks
        g2d.setComposite ( AlphaComposite.getInstance ( AlphaComposite.SRC_OVER, 0.0f ) );
		//piirto
        super.paintComponent(g);       
		//roinaa taustan päälle
        doDrawing(g);
        //turhat pois
        g2d.dispose();
		
	}
 

}

public class wtf {
    
   public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI(); 
            }
        });
    }

    private static void createAndShowGUI() {
        System.out.println("Created GUI on EDT? "+
        SwingUtilities.isEventDispatchThread());
        
        
        JFrame f = new JFrame("Swing Paint Demo");
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
 
        initialize demo = new initialize();
        
        f.setContentPane(demo.createContentPane());
        
        f.setPreferredSize(new Dimension(600, 600));
        	
        f.pack();
        
        f.setVisible(true);
    } 
    	
}

class initialize implements ActionListener {

    	JPanel panel1, panel2;

    	JLabel lblPane1_info, lblPane2_info;
    	JButton cmdButton1;
    	Timer timer;
    	
		superBall sB;
		
		
    	public JPanel createContentPane() {
    		
    		JPanel backGround = new JPanel();
    		
    			
    			backGround.setLayout(null);
		        
		        backGround.setBackground(new Color(200,200,210));
    			
    			
    			panel1 = new JPanel();
    			panel1.setLayout(null);
    			
    			panel1.setLocation(25,20);
    			
    			panel1.setSize(250,350);

				    lblPane1_info = new JLabel();
				    
				    lblPane1_info.setSize(110,20);
				    lblPane1_info.setText("Paneeli 1 - Ohjaus");
				    lblPane1_info.setLocation(panel1.getWidth() / 2 - lblPane1_info.getWidth() / 2,0);
				    lblPane1_info.setForeground(new Color(150,150,200));
				    lblPane1_info.setVisible(true);
				    
				    panel1.add(lblPane1_info);


				    cmdButton1 = new JButton();
				    
				    cmdButton1.setSize(100,30);
				    cmdButton1.setLocation(panel1.getWidth() / 2 -  cmdButton1.getWidth() / 2, panel1.getHeight() - cmdButton1.getHeight() - 20);
				    cmdButton1.setForeground(Color.BLACK);
				    cmdButton1.setText("Pyöritä");
				    cmdButton1.setVisible(true);
				    cmdButton1.addActionListener(this);
				    
				    panel1.add(cmdButton1);
				    

    			
    			panel1.setBorder(BorderFactory.createLineBorder(Color.gray));
    			
    			panel1.setVisible(true);
    			
    			backGround.add(panel1);
    			
    			//panel2 = new Surface();    			
    			panel2 = new JPanel();
    			panel2.setBackground(new Color(200,210,200));
    			panel2.setLayout(null);
    			panel2.setLocation(310, 20);
    			panel2.setSize(250,350);
				panel2.setOpaque(true);


				    lblPane2_info = new JLabel();
				    //lblPane1_info.setLayout(null);
				    lblPane2_info.setSize(120,20);
				    lblPane2_info.setText("Paneeli 2 - Grafiikka");
				    lblPane2_info.setLocation(panel2.getWidth() / 2 - lblPane2_info.getWidth() / 2,0);
				    lblPane2_info.setForeground(new Color(150,150,200));
				    lblPane2_info.setVisible(true);
				    
				    panel2.add(lblPane2_info);
					
					sB = new superBall();

					sB.setWidth(120);
					sB.setHeight(120);
					
					sB.setX(panel2.getWidth() / 2 - sB.getWidth() / 2);
					sB.setY(panel2.getHeight() / 2 - sB.getHeight() / 2);
	

					sB.setSize(sB.getWidth(),sB.getHeight());
					sB.setLocation(sB.getX(),sB.getY());

					//layeri on läpinäkyvä!
					//sB.setBackground(new Color(255,255,255,100));

					sB.setVisible(true);

    				//panel2.setOpaque(true);
					panel2.add(sB);


    			panel2.setBorder(BorderFactory.createLineBorder(Color.gray));
    			
    			panel2.setVisible(true);

    			backGround.add(panel2);
    			
			    //luo ajastin
			    timer = new Timer(50, this);

    		    backGround.setVisible(true);
    		    			
    		return backGround;
    		
    		
    	}
    	
    	public void actionPerformed(ActionEvent e) {
    		
    		if (e.getSource() == cmdButton1) {
    			if (cmdButton1.getText() == "Pyöritä") {
					cmdButton1.setText("Pysäytä");
    				timer.start();
    			}
    			else if (cmdButton1.getText() == "Pysäytä") {
					cmdButton1.setText("Pyöritä");
    				timer.stop();
    			}
    			
    		}
    		
    		if (e.getSource() == timer) {

    			handleRotate();			
    			
    		}
    	}
    	
    	public void handleRotate() {
	    	
	    	if (sB.getAngle() >= 359) {
	    		sB.setAngle(1);
	    	}
	    	else {
	    		sB.setAngle(sB.getAngle()+1);
	    	}
    	}
}