⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 traceresults.java

📁 熟悉非常简单CPU模拟器 1、将所给模拟器的源程序编译成执行程序。 2、运行并观察非常简单CPU模拟器
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;

public
class TraceResults
   extends Dialog
   implements ActionListener
{

   public TraceResults( Frame parent, String title )
   {
	super( parent, title );
        setLayout( new BorderLayout() );

   	traceBox = new TextArea(20, 100);
	traceBox.setEditable(false);
        traceBox.setBackground(Color.white);
   	add(traceBox, BorderLayout.CENTER);

   	okButton = new Button( "OK" );  
  	add(okButton, BorderLayout.SOUTH);     
   	okButton.addActionListener( this );
        
        traceBox.setText(" ");	 
        traceBox.setText("Trace of Program:"+newline);
   
      addWindowListener(

            new WindowAdapter()
            {

               public void windowClosing( WindowEvent e )
               {
		  //traceBox.setText(" ");
		  //traceBox.setText("Trace of Program:"+newline);
                  e.getWindow().setVisible( false );
               }

            }

         );

      setResizable( false );
      pack();
   }

   public void actionPerformed( ActionEvent evt )
   {
      Object eventSource = evt.getSource();

      if ( eventSource == okButton )
      {
         /*traceBox.setText(" ");	 
         traceBox.setText("Trace of Program:"+newline);
         dispose();*/
         this.setVisible( false );
      }

   }

   public static TextArea traceBox;      
   private Button okButton;
   static String newline = System.getProperty("line.separator");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -