java 文件打开方式_Java的源文件打开方式被设为记事本打开该 – 手机爱问

18533e580c0e9a508eeb96eb5a7adf3f.png

2017-07-27

Java画手机该如何编程呢?

代码如下:import java。awt。*;

import java。applet。*;

public class JavaPhone extends Applet

{

String str;

int x, y, ScrX, ScrY, KeyX, KeyY;

Image img;

public void init()

{

x=20; y=20;

ScrX=45; ScrY=72;

KeyX=45; KeyY=350;

img = getImage(getCodeBase(), "ScreenPic。 jpg");

}

public void paint(Graphics g)

{

/...全部

代码如下:import java。awt。*;

import java。applet。*;

public class JavaPhone extends Applet

{

String str;

int x, y, ScrX, ScrY, KeyX, KeyY;

Image img;

public void init()

{

x=20; y=20;

ScrX=45; ScrY=72;

KeyX=45; KeyY=350;

img = getImage(getCodeBase(), "ScreenPic。

jpg");

}

public void paint(Graphics g)

{

/*Background*/

g。setColor(new Color(60,60,60));

g。fillRoundRect(x, y, 250, 500, 50,50);

g。

setColor(new Color(0,0,0));

g。fillRoundRect(x+7, y+7, 235, 485, 30, 30);

/*white light*/

int[] v = {31,31,33,37,47,37,35};

int[] w = {50,38,33,31,31,35,37};

g。

setColor(new Color(255,255,255));

g。fillPolygon(v, w, v。length);

/*Nokia N73*/

Font f=new Font("Arial Black", Font。

PLAIN, 12);

g。setFont(f);

g。setColor(new Color(255,255,255));

g。drawString("NOKIA", x+25, y+28);

Font f1=new Font("Arial", Font。

PLAIN, 12);

g。setFont(f1);

g。drawString("N73", x+48, y+40);

/*3G Camera*/

g。setColor(new Color(255,255,255));

g。

fillRoundRect(x+175, y+15, 30, 30, 10, 10);

g。setColor(new Color(60,60,60));

g。fillRoundRect(x+177, y+17, 26, 26, 10, 10);

g。

setColor(new Color(0,0,0));

g。fillOval(x+185, y+25, 10, 10);

/*ear speaker*/

g。setColor(new Color(80,80,80));

g。

drawRoundRect(115, 43, 50, 15, 15, 15);

g。setColor(new Color(255,255,255));

g。fillRoundRect(121, 47, 38, 8, 10, 10);

/*Blue Light*/

g。

setColor(new Color(0,0,255));

g。fillRoundRect(x+158, y+24, 12, 12, 3, 3);

g。setColor(new Color(255,255,255));

g。

drawLine(x+160, y+29, x+160, y+26);

g。drawLine(x+160, y+26, x+161, y+25);

g。drawLine(x+161, y+25, x+164, y+25);

/*Key*/

g。

setColor(new Color(120,120,120));

g。drawRoundRect(KeyX, KeyY, 197, 150, 25, 30);

/*Uper Key Area*/

g。

setColor(new Color(255,255,255));

g。fillRoundRect(KeyX+10, KeyY+8, 177, 40, 20,20);

g。setColor(new Color(220,220,220));

g。

fillRoundRect(KeyX+20, KeyY+12, 157, 32, 10, 20);

g。setColor(new Color(70,70,70));

g。fillRoundRect(KeyX+60, KeyY+15, 80,26, 5, 5);

g。

setColor(new Color(180,180,180));

g。fillRoundRect(KeyX+62, KeyY+17, 76,22, 10, 10);

g。setColor(new Color(250,250,250));

g。

fillRoundRect(KeyX+91, KeyY+18, 20, 20, 5, 5);

g。setColor(new Color(100,100,100));

g。fillRoundRect(KeyX+93, KeyY+20, 16, 16, 4, 4);

g。

setColor(new Color(0,0,0));

g。fillRect(KeyX+10, KeyY+28, 81, 2);

g。fillRect(KeyX+111, KeyY+28, 76, 2);。

收起

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值