result_screen.java
来自「J2ME 开发中用到的XML语法分析程序,可供学习参考使用.」· Java 代码 · 共 67 行
JAVA
67 行
/**
* Basic packages used by various classes..
*
*/
import com.sun.kjava.*;
/**
* Decalaring a class result_screen which is responsible for
* showing the results in the ScrollTextBox
*/
public class result_screen extends Spotlet
{
/**
* Declaring the GUI components
*
*/
Button exit = new Button("Exit", 80,145);
ScrollTextBox result_box;
result_screen(String result)
{
/**
* Getting the Graphics and redrawing the screen.
*
*/
Graphics graphics = Graphics.getGraphics();
graphics.resetDrawRegion();
graphics.clearScreen();
/**
* Painting the title on the screen.,
*
*/
graphics.drawString("Result of parsing",25,2);
/**
* Registering the Spotlet and painting the GUI components.
*
*/
result_box = new ScrollTextBox(result,10,20,120,120);
exit.paint();
result_box.paint();
register(NO_EVENT_OPTIONS);
}
public void penDown(int x, int y)
{
/**
* Exit the program
*
*/
if (exit.pressed(x,y))
{
System.exit(0);
}
else if (result_box.contains(x,y))
result_box.handlePenMove(x,y);
}
public void penMove(int x, int y)
{
if (result_box.contains(x,y))
result_box.handlePenMove(x,y);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?