내 창에 버튼이있어서 버튼을 클릭하면 창이 닫힙니다.버튼을 클릭하여 JFrame을 닫는 방법은 무엇입니까?
나는 내가 다음과 같은 방법으로 창을 닫을 수 있다는 것을 발견
referenceToTheFrame.hide(); //hides the frame from view
refToTheFrame.dispose(); //disposes the frame from memory
을하지만이 방법을 수행 할 경우, 컴파일러는 불평 :
Note: myProgram.java uses or overrides a deprecated API
Note: Recompile with -Xlint:deprication for details.
내가 안전하지 않은 일을합니까?
"x"를 클릭하면 프레임이 닫히지 않습니까? –