你這個(gè)是代碼里面拼寫(xiě)錯(cuò)誤了,改成下面的可以顯示
讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛(ài)。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶,將通過(guò)不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:域名注冊(cè)、虛擬主機(jī)、營(yíng)銷軟件、網(wǎng)站建設(shè)、廣德網(wǎng)站維護(hù)、網(wǎng)站推廣。
class?DontStepOnWhitePiece?extends?JPanel
{
public?void?paint(Graphics?g)???//上面的這里拼寫(xiě)錯(cuò)誤,panit
{
super.paint(g);
g.setColor(Color.black);
g.drawRect(0,?0,?100,?100);
}
package?別踩白塊;
import?java.awt.GridLayout;
import?java.awt.event.MouseEvent;
import?java.awt.event.MouseListener;
import?javax.swing.JFrame;
public?class?Main?extends?JFrame?implements?MouseListener?{
Block[]?block=new?Block[9];
Block1?block1=new?Block1();
public?Main(){
setTitle("別踩白塊");
setBounds(200,300,200,300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new?GridLayout(3,3,5,5));
addblock();
bk();
this.setVisible(true);
}
public?void?addblock(){
for(int?i=0;i9;i++)
{
block[i]=new?Block();
add(block[i]);
}
}
public?void?bk(){
block1.setbk1(block[(int)(Math.random()*2)]);
block1.setbk1(block[(int)(Math.random()*2+4)]);
block1.setbk1(block[(int)(Math.random()*2+6)]);
}
public?void?over(){
block[3].setText("g");
block[4].setText("g");
block[5].setText("!");
}
public?static?void?main(String[]?args)?{
//?TODO?Auto-generated?method?stub
new?Main();
}
@Override
public?void?mouseClicked(MouseEvent?e)?{
//?TODO?Auto-generated?method?stub
}
@Override
public?void?mousePressed(MouseEvent?e)?{
//?TODO?Auto-generated?method?stub
if(e.getSource().equals(""));
over();
}
@Override
public?void?mouseReleased(MouseEvent?e)?{
//?TODO?Auto-generated?method?stub
}
@Override
public?void?mouseEntered(MouseEvent?e)?{
//?TODO?Auto-generated?method?stub
}
@Override
public?void?mouseExited(MouseEvent?e)?{
//?TODO?Auto-generated?method?stub
}
}
小弟啊,看來(lái)你真的是初學(xué)啊,抽象類Friut定義在哪個(gè)包中都可以,但是在它的子類中要導(dǎo)入,importFruit這個(gè)類,然后在Fruit這個(gè)類中定義一個(gè)抽象方法harvest(),不做任何實(shí)現(xiàn)就可以啦