개발

애플릿에서 브라우저 url 변경하기

에드몽단테스 2007. 7. 27. 14:33

AppletContext를 얻어온 후 showDocument()를 호출한다.

AppletContext ac = getAppletContext();
ac.showDocument(new URL(http://dantes.kr));


새창에서 띄우고 싶다면 아래의 메소드를 호출하면 된다.

showDocument(URL url, String target)

  타겟의 옵션(api 발췌)
Target Argument Description
"_self" Show in the window and frame that contain the applet.
"_parent" Show in the applet's parent frame. If the applet's frame has no parent frame, acts the same as "_self".
"_top" Show in the top-level frame of the applet's window. If the applet's frame is the top-level frame, acts the same as "_self".
"_blank" Show in a new, unnamed top-level window.
name Show in the frame or window named name. If a target named name does not already exist, a new top-level window with the specified name is created, and the document is shown there.

반응형