设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 编程开发 >> Java >> 用Applet写的菜单程序 machine
精品推荐
Java点击TOP10
·我写的Java学生成绩管理系统源代码
·java笔试题
·异常java.sql.SQLException: Io exception:The Network Adapter could not establish connection
·MyEclipse 下开发JSF教程
·java网络五子棋的源代码
·servlet和JSP过滤器Filter
·用Eclipse Visual Editor 开发SWT GUI
·JSF+Spring+Hibernate的实例讲解(原创翻译)
·一个相对不错的地区代码级联实现
·《Thinking in Java》读书笔记
编程开发点击TOP10
·数字小键盘指法练习
·ASP.NET 程序中常用的三十三种代码
·用C语言编通讯录程序(初学者级别的)
·我写的Java学生成绩管理系统源代码
·CHK文件恢复工具
·Modem 常用AT指令集
·java笔试题
·异常java.sql.SQLException: Io exception:The Network Adapter could not establish connection
·单片机模拟I2C总线及24C02(I2C EEPROM)读写实例(源代码)
·C++经典电子书下载
精选专题

用Applet写的菜单程序 machine

作者: 来源:网络文章 时间:2005-12-16 22:41:56

用Applet写的菜单程序 machine(4) int[] result = new int[st.countTokens()];

for (int i=0; i result[i] = Integer.parseInt(st.nextToken());
}
return result;
}

public void paint(Graphics g) {
imageDone = false;
update(g);
}

public void update(Graphics g) {
Graphics g2;

if (!imageDone) {
imageDone = g.drawImage(image, 0, 0, this);
return;
}

bbufG.setColor(bgColor);
bbufG.fillRect(0, 0, size().width, size().height);
bbufG.drawImage(image, 0, 0, this);

if (curMenu >= 0) {
g2 = bbuf.getGraphics();
// Paint the overlay image
g2.clipRect(dstPt[curMenu].x, dstPt[curMenu].y,
srcRect[curMenu].width, srcRect[curMenu].height);
g2.drawImage(image, dstPt[curMenu].x-srcRect[curMenu].x,
dstPt[curMenu].y-srcRect[curMenu].y, this);
g2.dispose();

g2 = bbuf.getGraphics();
for (int i=0; i drawMenuItem(g2, i);
}
g2.dispose();
}
g.drawImage(bbuf, 0, 0, this);
}

void drawMenuItem(Graphics g, int i) {
int x, y, w, height;
// break the menu item label into lines.
String[] line = parse(item[curMenu][i], getParameter("newline"));

int hi = 0;
if (i == curMenuItem) {
hi = 1;
getAppletContext().showStatus(itemUrl[curMenu][i]);
}
g.setColor(bgMenuColor[hi]);
g.fillRect(menuItemRect[i].x, menuItemRect[i].y,
menuItemRect[i].width, menuItemRect[i].height);

// set color for text and box
g.setColor(fgMenuColor[hi]);

// draw box around menu item.
g.drawRect(menuItemRect[i].x, menuItemRect[i].y,
menuItemRect[i].width, menuItemRect[i].height);

// draw label
g.setFont(f);
y = menuItemRect[i].y + marginV;
for (i=0; i g.drawString(line[i],
menuItemRect[i].x+menuItemRect[i].width-fm.stringWidth(line[i])
-marginH, y + fm.getAscent());
y += fm.getHeight();
}
}

public boolean mouseExit(Event evt, int x, int y) {

共6页 9 7 [1] [2] [3] [4] [5] [68 :>

用Applet写的菜单程序 machine 相关文章:
用Applet写的菜单程序 machine 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com