run 메소드 안에 loadPage 메소드 실행 시키는 방법이 궁금해요
조회수 284회
새로운 메소드 (run method)를 써서 버튼이 클릭 되었을때 loadPage 메소드를 실행시켜야 하는데 run 메소드 안에 어떤 코드를 적어야 할지 모르겠어요..
private void loadPage() {
urlButton.setDisable(true);
textFlow.getChildren().clear();
try {
URL url = new URL(DELAY_URL + urlField.getText());
Scanner site = new Scanner(url.openStream());
while (site.hasNextLine()) {
String line = site.nextLine();
textFlow.getChildren().add(new Text(line + "\n"));
} //whilte
} catch (IOException ex) {
textFlow.getChildren().add(new Text(ex.getMessage()));
} //try
urlButton.setDisable(false);
} //loadPage
public void run() {
}
댓글 입력