hi i am having a bit of trouble displaying the mouse position in JTextField. i have currently done this code. i need to display the x and y positions inside the textfield.

private JTextField xTextField, yTextField;
private int mouseX, mouseY;

JPanel mousePanel = new JPanel();
    xTextField = new JTextField (10);
    yTextField = new JTextField (10);
    visibleArea.add(mousePanel, BorderLayout.NORTH);
public void mousePressed(MouseEvent e) {
   mouseX = e.getX();
   mouseY = e.getY();

i am sure i am forgeting something very straight forward but if anyone knows how i can do this it would be greatly appreciated.

You've forgotten to put the values of mouseX and mouseY into the two TextFields