I have this pong game, and the ball is just passing through the sensor. Why is this happening?




Java Code:
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;
import java.io.File;

import javax.imageio.ImageIO;
import javax.swing.*;
public class Pong extends JComponent{
int pongX=200;
int pongY=200;
int pongXspeed = 3;
int pongYspeed = 3;
int pongDiameter = 60;
int SliderOneX = 5;
int SliderOneY = 200;
int SliderTwoX = 465;
int SliderTwoY = 200;
int p1points;
int p2points;
private BufferedImage image;
private BufferedImage pongball;

public Pong(){
	try{
		image = ImageIO.read(new File(
				"/Users/MW/Downloads/formatter.jpg"));
		pongball = ImageIO.read(new File(
				"/Users/MW/Downloads/pongball.png"));
	}catch(Exception e){System.out.print("Could not load image");}
}
	public void paintComponent(Graphics g){
		super.paintComponent(g);
		g.setColor(Color.black);
		g.drawImage(image,0,0,null);
		g.drawString("Copyright MW",50,450);
		g.setColor(Color.white);
		g.drawString("Player 1 Score: "+p1points, 50, 20);
		g.drawString("Player 2 Score: "+p2points, 350, 20);
		g.setColor(Color.black);
		g.drawImage(pongball, pongX, pongY, null);
		g.setColor(Color.blue);
		g.fillRect(SliderOneX, SliderOneY, 30, 120);
		g.fillRect(SliderTwoX, SliderTwoY, 30, 120);
		
	}
public void MoveBall(){
	pongX += pongXspeed;
	if(pongX==SliderOneX + 30 && pongY>=SliderOneY-80 && pongY<=SliderOneY+120 || pongX+65==SliderTwoX && pongY>=SliderTwoY-80 && pongY<=SliderTwoY+120){
		pongXspeed *= -1;
	}
	pongY += pongYspeed;
	if(pongY > getHeight()-pongDiameter || pongY < 0){
		pongYspeed *= -1;
	}
	if(pongX>500){
		pongX = 200;
		pongY = 200;
		p1points++;
	}
	if(pongX<-30){
		pongX = 200;
		pongY = 200;
		p2points++;
	}
	if(SliderOneY<=-15){
		SliderOneY=SliderOneY+15;
	}
	if(SliderOneY>360){
		SliderOneY=SliderOneY-15;
	}
	if(SliderTwoY <=-15){
		SliderTwoY=SliderTwoY+15;
	}
	if(SliderTwoY>360){
		SliderTwoY=SliderTwoY-15;
	}
	if(pongY>SliderTwoY){
	SliderTwoY=SliderTwoY+10;	
	repaint();
	}
	if(pongY<SliderTwoY){
		SliderTwoY=SliderTwoY-10;
	}
	repaint();
}
KeyListener k = new KeyListener(){
@Override
public void keyTyped(KeyEvent e) {
	// TODO Auto-generated method stub
	
}
@Override
public void keyPressed(KeyEvent e) {
	int k = e.getKeyCode();
	if (k == KeyEvent.VK_UP) {
		SliderOneY -= 15;
	}
	if (k == KeyEvent.VK_DOWN){
		SliderOneY += 15;
	}
	repaint();
}
@Override
public void keyReleased(KeyEvent e) {
	// TODO Auto-generated method stub
}
};
}