ells.java~38~
来自「Jbuilder100个例子 都是经典例子 对大家学习Jbuilder非常有帮助」· JAVA~38~ 代码 · 共 57 行
JAVA~38~
57 行
package dot;import java.awt.*;import java.awt.event.*;import java.applet.*;public class ells extends Applet { int x,y; int i,j,k; Color mycolor; boolean isStandalone = false; /**Get a parameter value*/ public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } public void init() { paint(); } } /**Construct the applet*/ /**Initialize the applet*/ /**Component initialization*/ /**Get Applet information*/ public String getAppletInfo() { return "Applet Information"; } /**Get parameter info*/ public String[][] getParameterInfo() { return null; } void this_mousePressed(MouseEvent e) { x=e.getX(); y=e.getY(); repaint(); } public void paint(Graphics g){ if(x>255) i=x-255; else i=x; if(y>255) j=y-255; else j=y; if(i+j>255) k=i+j-255; else k=i+j; mycolor=new Color(i,j,k); g.setColor(mycolor); g.fillOval(x-10,y-10,20,20); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?