そりゃぁ、どこかでAパネルを受け取らないとだめだろう。
class A extends JPanel 〜{
    B newwindow = new B(this);
}
class B extends JFrame 〜{
    B(A apanel){
        this.setLocationRelativeTo(apanel);
    }
}