okay I am getting somewhere. I now have a class that extends jPanel and draws a line on it when the program starts:
class yurPanel extends JPanel {

public yurPanel () {
setBorder(BorderFactory.createLineBorder(Color.bla ck));
}

@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);

// Draw Text
g.drawString("This is my custom Panel!",10,20);
g.drawLine(4, 4, 30, 20);


}
public void paintLine(Graphics g) {
super.paintComponent(g);

g.drawLine((int)currentXdouble, (int)currentYdouble, (int)previousXdouble,(int)previousYdouble);


}

I also wrote code that remembers the current mouse x,y when clicked on the panel and the previous x,y to draw the lines- the question is how do I draw something when I click on the panel??


my current feeble attempt:
private void jPanel1MouseClicked(java.awt.event.MouseEvent evt) {


//This code "saves the mouse positions"
PointerInfo pointerInfo = MouseInfo.getPointerInfo();
Point point = pointerInfo.getLocation();
// x1_Label.setText(point.toString());
double xCoord= point.getX();
double yCoord= point.getY();

previousXdouble=currentXdouble;
previousYdouble=currentYdouble;

currentXdouble=xCoord;
currentYdouble=yCoord;


currentX.setText(Double.toString(currentXdouble));
currentY.setText(Double.toString(currentYdouble));

previousX.setText(Double.toString(previousXdouble) );
previousY.setText(Double.toString(previousYdouble) );

//this code actually "tries" to paint the lines, completely incorrectly

Graphics Line = null;
Line.drawLine((int)currentXdouble, (int)currentYdouble, (int)previousXdouble,(int)previousYdouble);
jPanel1.paintComponents(Line);



}
I have tried looking for the "yurPanel" extension class by typing "jPanel1._____" but it's not there. Please help!