?? beanpanel.java
字號:
package basketball;
import java.awt.*;
import java.net.URL;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class BeanPanel extends Panel {
QuestionBean q;
private Image img;
public BeanPanel(){}
public BeanPanel(QuestionBean qb){
this.q = qb;
}
public void setQuestionBean(QuestionBean qb){
this.q = qb;
}
public void paint(Graphics g){
URL url = null;
try {
url = Class.forName("basketball.Basketball").getResource(q.getImageUrl());
}
catch (Exception e) {}
img = getToolkit().getImage(url);
MediaTracker mt = new MediaTracker(this);
mt.addImage(img, 1);
try {
mt.wait();
mt.checkAll();
}
catch (Exception e) {}
g.drawImage(img, 125, 0, 160, 200, this);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -