Java Swing MouseListener issue

I'll have to segment the code in comments because it's too large for Discord. I have a frame, a container, and two components in the container. I made the components draggable with
final Point start = new Point();
addMouseListener(new MouseAdapter() {
    @Override
    public void mousePressed(MouseEvent e) {
        System.out.println("click");
        start.setLocation(e.getPoint());
        bringToFront();

        switch (e.getButton()) {
            case MouseEvent.BUTTON2:
                getParent().remove(ContainerItemStack.this);
                break;
            case MouseEvent.BUTTON3:
                getParent().split(ContainerItemStack.this);
                break;
        }
    }
});
addMouseMotionListener(new MouseMotionAdapter() {
    @Override
    public void mouseDragged(MouseEvent e) {
        System.out.println("drag");
        Point c = e.getLocationOnScreen();
        Point p = getParent().getLocationOnScreen();
        setLocation(c.x - p.x - start.x, c.y - p.y - start.y);
        bringToFront();
    }
});

It was working a few minutes ago, but now the mouse listeners aren't being triggered. Full code in comments
Was this page helpful?