📄 midpprogressbar.java
字号:
package istarion.midlet;
import javax.microedition.lcdui.*;
import istarion.frontend.*;
public class MIDPProgressBar implements ProgressBar
{
Display __display = null;
Form __form = null;
Gauge __gauge = null;
int __maxSteps = 10;
int __currStep = 0;
public MIDPProgressBar(Display d)
{
__gauge = new Gauge("Progress", false, __maxSteps, 0);
__form = new Form(null);
__form.append(__gauge);
__display = d;
}
public void doShow()
{
__display.setCurrent(__form);
}
public void setText(String txt)
{
__gauge.setLabel(txt);
}
public void setSteps(int steps)
{
__maxSteps = steps;
__gauge.setMaxValue(__maxSteps);
}
public void nextStep()
{
if (__currStep < __maxSteps)
{
__currStep++;
__gauge.setValue(__currStep);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -