我想要dispose()
我的当前jFrame
并移动到下一个 jFrame(StudentProfilepage())。但它在this.dispose()
.
我该怎么做。我在这里使用MouseListner
了一个jLabel l1
我的代码如下
l1.setCursor(Cursor.getDefaultCursor());
l1.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
//added check for MouseEvent.BUTTON1 which is left click
if (e.isPopupTrigger() || e.getButton() == MouseEvent.BUTTON1) {
this.dispose(); //error here(i want to close my current frame and move to StudentProfile() page
new StudentProfilePage().setVisible(true);
}
}
});