publicclass CopyAreaSpeed extends Applet implements Runnable { int top = 0;
publicvoid init() {
}
public CopyAreaSpeed()
{ super();
String[] instructions =
{ "This test prints out the time it takes for a certain amount ", "of copyArea calls to be completed. Because the performance ", "measurement is relative, this code only provides a benchmark ", "to run with different releases to compare the outcomes."
};
Sysout.createDialogWithInstructions( instructions );
(newThread(this)).start();
Button bt = new Button("Hello");
bt.setBounds(50, 10, 50, 22);
bt.setVisible(false);
add(bt);
}
TextArea instructionsText;
TextArea messageText; int maxStringLength = 80;
//DO NOT call this directly, go through Sysout public TestDialog( Frame frame, String name )
{ super( frame, name ); int scrollBoth = TextArea.SCROLLBARS_BOTH;
instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
add( "North", instructionsText );
//DO NOT call this directly, go through Sysout publicvoid printInstructions( String[] instructions )
{ //Clear out any current instructions
instructionsText.setText( "" );
//Go down array of instruction strings
String printStr, remainingStr; for( int i=0; i < instructions.length; i++ )
{ //chop up each into pieces maxSringLength long
remainingStr = instructions[ i ]; while( remainingStr.length() > 0 )
{ //if longer than max then chop off first max chars to print if( remainingStr.length() >= maxStringLength )
{ //Try to chop on a word boundary int posOfSpace = remainingStr.
lastIndexOf( ' ', maxStringLength - 1 );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.