문법 오류가 아닌 것 같은데 오류네요 설명을 좀 ^^;
뽀글이
import java.awt.*;
import java.awt.event.*;
public class GGesangi extends Frame{
super(java call);
private Choice a;
private Button b1,b2,b3,b4;
private TextField tf;
public GGesangi(){
this.setLayout(new FlowLayout());
this.b1=new Button(+);
this.b2=new Button(-);
this.b3=new Button(*);
this.b4=new Button(/);
//
this.a=new Choice();
a.add(초급);
a.add(중급);
a.add(고급);
this.add(a,Colors);
//
this.tf=new TextField(10);
//
ActionListener al=new ActionListener(){
public void actionPerformed(ActionEvent ae){
if(ae.getSource()==b1){
b1.setEnabled(false);
tf.setBackground(Color.green);
tf.setText(ae.getActionCommand());
}
else if(ae.getSource()==b2){
b2.setEnabled(false);
tf.setBackground(Color.green);
tf.setText(ae.getActionCommand());
}
else if(ae.getSource()==b3){
b3.setEnabled(false);
tf.setBackground(Color.green);
tf.setText(ae.getActionCommand());
}
else{
b4.setEnabled(false);
tf.setBackground(Color.green);
tf.setText(ae.getActionCommand());
}
}
}; // 컴포넌 끝
//
this.b1.addActionListener(al);
this.b2.addActionListener(al);
this.b3.addActionListener(al);
this.b4.addActionListener(al);
//
//
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
//
this.add(b1);
this.add(b2);
this.add(b3);
this.add(b4);
//
this.add(tf);
}
public static void main(String[] args)
{
GGesangi ae=new GGesangi();
ae.setSize(200,200);
ae.setVisible(true);
}
}
툴을 만드는 중인데..
제작중 테스트 해보던 중 에러가 뜨는데
지금은 그부분 지우고 작업하는데...super(java call);
이부분이 애러ㅣ.. -_-;; 이상한데.. 아무리 봐도 틀리지 않은 것 같은데... 지우니까 되긴하는데..
이상하네요. 아무리 봐도 틀린게 없는데.. -_-;;그리고 버튼 누르면 TextFiled 전체의 색이 바뀌는데.
표시되는 글자만 색 바뀌는 방법좀 가르쳐주세요. ^^;;그리고 이건 제가 심심해서 ActionLister의 메모리를 만들기 전에
this.b1.addActionListener(al);먼저쓰고 그담에 메모리와 컴포넌트 만드니까 에러나네요.
뭔가 규칙이 있는건가요? ^^
-
허리품 2025-10-20
ㅎㅎㅎ... 생성자에 왜 안넣었을까요..;;
-
가온누리 2025-10-20
super(\java call\); 이라인을 생성자에 집어 넣으이소 frame의 세가지 생성자중에 frame(string str)에 \java call\이라는 스트링객체를 전달해서 타이틀을 설정한다카는건 아시지예? 그리고 나머지 궁금점은 다 구현한다음에&nbs
| 번호 | 제 목 | 글쓴이 | 날짜 |
|---|---|---|---|
| 2752110 | $box.find("img").width()에서 이미지에.. | 해뜰참 | 2026-10-21 |
| 2752024 | 소숫점 뺄셈 !! ㅠㅜ | 초롬 | 2026-10-20 |
| 2751970 | 자바 게임 만들려는데 부탁드립니다 (1) | 라온제나 | 2026-10-19 |
| 2751908 | 자바스크립트 처리속도를 체크할 수 있는 방법 있나요? (1) | 테이 | 2026-10-19 |
| 2751822 | 그누보드 아이프레임으로 구현했는데 제목 클릭해서 들어가면 푸터가 동동...떠다녀요 | 내꺼하자 | 2026-10-18 |
| 2751790 | 자바 그래픽 관련을 공부하고 싶은데요.. 어디 좋은 사이트나 책 없을까요?? (1) | 큰재 | 2026-10-18 |
| 2751733 | CTF가머죠? (5) | 두동 | 2026-10-17 |
| 2751709 | 배열부분 궁금한 부분이있습니다. | 딸기우유 | 2026-10-17 |
| 2751677 | 포인터 책을 보다가,,, (2) | 동백 | 2026-10-17 |
| 2751648 | 익스플로 버전에 따라서 생기는 공백.. (1) | 모아 | 2026-10-17 |
| 2751623 | DEL 태그의에서 선굵기 및 컬러지정이 가능한가 해서요~ (4) | 비치나 | 2026-10-16 |
| 2751573 | 테마 업로드 에러.. (1) | 꽃 | 2026-10-16 |
| 2751548 | 수학? 물리?? (3) | 찬늘 | 2026-10-16 |
| 2751461 | 상단네비 fixed ie6 핵 해결방안이 있을까요? | 맑다 | 2026-10-15 |
| 2751436 | 레이아웃을 잡고 코딩을 하는데 드림위버에서의 결과와 IE에서 결과가 다르게 나오네요. (3) | 키클 | 2026-10-15 |
| 2751403 | 형들좀도와주세요string compression (1) | 알렉산더 | 2026-10-14 |
| 2751349 | 링크 다운로드하기 | 팬지 | 2026-10-14 |
| 2751295 | c++한번도 손않댄 사람이... | 날위해 | 2026-10-13 |
| 2751267 | 플래시8 사용에서 플레이어 만들었는데요 (1) | 블1랙캣 | 2026-10-13 |
| 2751182 | 회원가입 | 파랑새 | 2026-10-12 |
