社区
Java SE
帖子详情
how to repaint label components immediately?
zxgcharles
2000-03-03 01:42:00
in applet (IE Browser)
i want to repaint a label component immediately to reflect some state change. but it's delay.what can i do
thanks!
...全文
113
1
打赏
收藏
how to repaint label components immediately?
in applet (IE Browser) i want to repaint a label component immediately to reflect some state change. but it's delay.what can i do thanks!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
ahfei
2000-03-03
打赏
举报
回复
我试了下,没有什么问题,代码如下.每按一下button,label上的数字就加1
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class Applet1 extends Applet {
boolean isStandalone = false;
Label label1 = new Label();
Button button1 = new Button();
int Count=0;
//Get a parameter value
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
}
//Construct the applet
public Applet1() {
}
//Initialize the applet
public void init() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
label1.setText("label1");
button1.setLabel("button1");
button1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
button1_actionPerformed(e);
}
});
this.add(label1, null);
this.add(button1, null);
}
//Get Applet information
public String getAppletInfo() {
return "Applet Information";
}
//Get parameter info
public String[][] getParameterInfo() {
return null;
}
void button1_actionPerformed(ActionEvent e) {
Count++;
label1.setText(String.valueOf(Count));
}
}
[C6] Andrew Ng - Convolutional Neural Networks
About this Course This course will teach you how to build convolutional neural networks and apply it to
im
age data. Thanks to deep learning, computer vision is working far better than just two years ...
Introduction to Indy (转载)
<script type="text/javascript"
Project Requirements
Project Requirements Create a new Eclipse workspace named "Project_1234567890" on the desktop of your computer (replace 1234567890 with your student ID number). For each question below, create a new project in that workspace. Call each pr...
react虚拟dom原理_快速了解React及其虚拟DOM的工作原理
react虚拟dom原理This is part of my “React for beginners” series on introducing React, its core features and best practices to follow. More articles are coming! 这是我的“初学者React”系列的一部分,该系列介绍了React,其核心功能和可遵循的最...
java中的gif,标签中的gif的Java问题
A gif that I tried to put into a JPanel isn't showing up after clicking the button that triggers it until I resize the window. When it does show up, it does not fit the JPanel and is not an
im
ated. I l...
Java SE
62,615
社区成员
307,307
社区内容
发帖
与我相关
我的任务
Java SE
Java 2 Standard Edition
复制链接
扫一扫
分享
社区描述
Java 2 Standard Edition
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章