progressbarupdate.java
来自「java技术内幕源代码,配合书籍看有事半功倍的效果」· Java 代码 · 共 38 行
JAVA
38 行
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
/*
<APPLET
CODE = progressbarupdate.class
WIDTH = 400
HEIGHT = 200 >
</APPLET>
*/
public class progressbarupdate extends JApplet
{
JProgressBar jprogressbar = new JProgressBar();
JButton jbutton = new JButton("Increment the progress bar");
public void init()
{
Container contentPane = getContentPane();
contentPane.setLayout(new FlowLayout());
contentPane.add(jprogressbar);
contentPane.add(jbutton);
jprogressbar.setStringPainted(true);
jbutton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
jprogressbar.setValue(jprogressbar.getValue() + 10);
}
});
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?