게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
자바 문법 질문점요~
게시물ID : programmer_7123짧은주소 복사하기
작성자 : supernova
추천 : 0
조회수 : 429회
댓글수 : 9개
등록시간 : 2014/12/14 17:50:09
옵션
  • 본인삭제금지
볼드표시 되어있는 부분에서 출력이 안되는데 이상하네요. 
문법적으로 오류가 없는거 같은데............. 고수분들 헬프점여! 


class Panel1 extends Panel implements ActionListener {
private GridLayout gl = new GridLayout(2, 2);
private Label filename_lb = new Label(" Input file name");
private TextField filename_tf = new TextField();
private Label word_lb = new Label(" Input word");
private TextField word_tf = new TextField();
private Panel2 p2;
public Panel1() {
this.setLayout(gl);
this.add(filename_lb);
this.add(filename_tf);
this.add(word_lb);
this.add(word_tf);
}
public Panel1(Panel2 p) {
this.p2 = p;
}

public void actionPerformed(ActionEvent e) {
// System.out.println("hello"+p1.getFilename_tf().getText());
if (e.getSource() == p2.bt) {
try {
System.out.println("go");
search();
} catch (IOException ie) {

}
} else {
System.out.println("no");
}
}

public void search() throws IOException {
System.out.println(filename_tf.getText()); <------------ 여기서 아무 출력도 나오지 않습니다.
System.out.println(word_tf.getText());
}
}


class Panel2 extends Panel   {
private FlowLayout fl = new FlowLayout(FlowLayout.RIGHT);
Button bt = new Button("Search");

public Panel2() {
this.setLayout(fl);
this.add(bt);
bt.addActionListener(new Panel1(this));
}
}

전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호