p; gten.drawLine(X,topMargine,X,h+topMargine);
x0=X;
y0=Y;
}
finally{
gten.dispose();
}
}
}
});
}
catch(Exception e)
{
System.out.println("sellhis construct add mouse listener error!");
System.out.println(e);
}
}
public void paint(Graphics g){
try{
g.drawString("股票代碼:",20,topMargine-15);
g.drawString("賣空成交金額:",150,topMargine-15);
g.drawString("賣空成交金額占總賣空成交金額%:",320,topMargine-15);
g.drawRect(leftMargine,topMargine,w,h); //矩形方框
int x0,y0,x1,y1,dy;
int totalStick=(majStick-1)*minStick;
x0=leftMargine;
dy=h/((majStick-1)*minStick);
for(int I=1;I<=totalStick;I++){
y0=height-buttomMargine-I*dy;
y1=y0;
x1=x0-minStickLength;
if(I%minStick==0){
x1=x0-majStickLength;
g.drawString(""+((I)/minStick)+"0%",x1-25,y0+5); //y轴刻度数字
}
g.drawLine(x0,y0,x1,y1); //y轴刻度标
}
for(int I=0;I<Len;I++){
x0=leftMargine+I*hx;
hy=(int)((xPce[I]/100)*(h/((majStick-1)*10)));
y0=height-buttomMargine-hy;
float pcent=(xPce[I]/100);
Color pceCololr=new Color(153,0,153);
g.setColor(pceCololr);
g.setFont(new Font("Times New Roman",Font.PLAI