Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.54 KB | None | 0 0
  1.  
  2. package architecture.project;
  3.  
  4. import java.awt.Container;
  5.  
  6. import javax.swing.JFrame;
  7. import javax.swing.JLabel;
  8. import javax.swing.JTextField;
  9.  
  10. public class ArchitectureProject {
  11.  
  12.     class memory
  13.             {
  14.                 double address;
  15.                 double data;
  16.                 public void memory(double a, double d)
  17.                 {
  18.                     this.address=a;
  19.                     this.data=d;
  20.                 }
  21.  
  22.    
  23.     }
  24.     enum op{
  25.         add,addi,j,beq,
  26.     }
  27.     class mainframe extends JFrame
  28.     {
  29.         JLabel numofinst;
  30.         JLabel fisrtinst;
  31.         JLabel fisrtreg;
  32.         JLabel secreg;
  33.         JLabel thirdreg;
  34.         JTextField noofinst;
  35.         JTextField tfisrtreg;
  36.         JTextField tsecreg;
  37.         JTextField tthirdreg;
  38.         JTextField tfirstinst;
  39.         mainframe()
  40.         {
  41.             this.setTitle("SIMULATOR");
  42.             this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  43.             this.setSize(1000, 1000);
  44.             JLabel numofinst = new JLabel("enter num of instructions");
  45.             numofinst.setBounds(0, 0, 300, 100);
  46.             JLabel firstinst = new JLabel("enter the instruction");
  47.             JLabel firstreg = new JLabel("enter first register");
  48.             JLabel secreg = new JLabel("enter second register");
  49.             JLabel thirdreg = new JLabel("enter third register");
  50.             JTextField noofinst = new JTextField();
  51.         JTextField tfirstinst = new JTextField();
  52.         JTextField tfirstreg = new JTextField();
  53.         JTextField tsecreg= new JTextField();
  54.         JTextField tthirdreg = new JTextField();
  55.         noofinst.setBounds(0, 100, 300, 100);
  56.         firstinst.setBounds(0, 200, 300, 100);
  57.         tfirstinst.setBounds(0, 300, 300, 100);
  58.         firstreg.setBounds(0, 400, 300, 100);
  59.         tfirstreg.setBounds(0, 500, 300, 100);
  60.         secreg.setBounds(0, 600, 300, 100);
  61.         tsecreg.setBounds(0, 700, 300, 100);
  62.         thirdreg.setBounds(0, 800, 300, 100);
  63.         tthirdreg.setBounds(0, 900, 300, 100);
  64.         Container c = this.getContentPane();
  65.         c.add(noofinst);
  66.         c.add(numofinst);  
  67.         c.add(firstinst);
  68.         c.add(tfirstinst);
  69.         c.add(firstreg);
  70.         c.add(tfirstreg);
  71.         c.add(secreg);
  72.         c.add(tsecreg);
  73.         c.add(thirdreg);
  74.                 c.add(tthirdreg);
  75.  
  76.  
  77.         this.setVisible(true);
  78.            
  79.         }
  80.  
  81.      
  82.     }
  83.     public static void main(String[] args) {
  84.         mainframe mf = new mainframe();
  85.        
  86.        
  87.     }
  88.    
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement