[질문]쉬운건데요~ ㅠ.ㅠ 왜 이미지가 안보이는걸까요?
단순드립
지식인에서.. 물어봤더니...
대답해주셨는데...
잘 모르겠어서요~ ㅠ.ㅠ
급해서 그런데... 되도록 빨리 알려주세요~ ㅠ.ㅠ
소스 입니다.
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
public class ReTest extends Applet implements ItemListener
{
Label myLabel,myLabel1;
Checkbox radio1,radio2,radio3,radio4,radio5;
CheckboxGroup group;
Image myImg;
Panel radioPanel;
public static void main(String args[]){
ReTest rt = new ReTest();
rt.init();
}
public void init()
{
String day = getParameter(myImg);
myImg = getImage(getDocumentBase(),day.jpg);
setLayout(new BorderLayout());
myLabel1 = new Label();
myLabel1.setText(확인문제 다음 한자의 훈과 음을 맞춰보세요.);
myLabel1.setAlignment(Label.CENTER);
myLabel1.setBackground(Color.green);
add(North,myLabel1);
radioPanel = new Panel();
radioPanel.setLayout(new GridLayout(5,1));
myLabel = new Label();
myLabel.setText( );
myLabel.setAlignment(Label.CENTER);
myLabel.setBackground(Color.yellow);
add(South,myLabel);
group = new CheckboxGroup();
radio1 = new Checkbox(산 산, group, false);
radio1.addItemListener(this);
radioPanel.add(radio1);
radio2 = new Checkbox(날 일, group, false);
radio2.addItemListener(this);
radioPanel.add(radio2);
radio3 = new Checkbox(내 천, group, false);
radio3.addItemListener(this);
radioPanel.add(radio3);
radio4 = new Checkbox(달 월, group, false);
radio4.addItemListener(this);
radioPanel.add(radio4);
radio5 = new Checkbox(풀 초, group, false);
radio5.addItemListener(this);
radioPanel.add(radio5);
add(Center,radioPanel);
}
public void itemStateChanged(ItemEvent e)
{
if(e.getSource()==radio1){
myLabel.setText(산 산 = 정답이 아닙니다);
}else if (e.getSource()==radio2){
myLabel.setText(날 일 = 정답입니다);
}else if (e.getSource()==radio3){
myLabel.setText(내 천 = 정답이 아닙니다);
}else if (e.getSource()==radio4){
myLabel.setText(달 월 = 정답이 아닙니다);
}else if (e.getSource()==radio5){
myLabel.setText(풀 초 = 정답이 아닙니다);
}
}
public void paint(Graphics g)
{
g.drawImage(myImg,300,30,this);
}
}