private MenuItem print1Menu = new MenuItem("PrintTest1"); private MenuItem print2Menu = new MenuItem("PrintTest2"); private MenuItem exitMenu = new MenuItem("Exit");
publicstaticvoid main(String[] argv) {
String[] instructions =
{ "You must have a printer available to perform this test,", "prefererably Canon LaserShot A309GII.", "Printing must be done in Win 98 Japanese 2nd Edition.", "", "Passing test : Output of text image for PrintTest1 and PrintTest2 should be same as that on the screen.",
};
privatevoid initMenu() {
MenuBar mb = new MenuBar();
Menu me = new Menu("File");
me.add(print1Menu);
me.add(print2Menu);
me.add("-");
me.add(exitMenu);
mb.add(me); this.setMenuBar(mb);
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.