Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package architecture.project;
- import java.awt.Container;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JTextField;
- public class ArchitectureProject {
- class memory
- {
- double address;
- double data;
- public void memory(double a, double d)
- {
- this.address=a;
- this.data=d;
- }
- }
- enum op{
- add,addi,j,beq,
- }
- class mainframe extends JFrame
- {
- JLabel numofinst;
- JLabel fisrtinst;
- JLabel fisrtreg;
- JLabel secreg;
- JLabel thirdreg;
- JTextField noofinst;
- JTextField tfisrtreg;
- JTextField tsecreg;
- JTextField tthirdreg;
- JTextField tfirstinst;
- mainframe()
- {
- this.setTitle("SIMULATOR");
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- this.setSize(1000, 1000);
- JLabel numofinst = new JLabel("enter num of instructions");
- numofinst.setBounds(0, 0, 300, 100);
- JLabel firstinst = new JLabel("enter the instruction");
- JLabel firstreg = new JLabel("enter first register");
- JLabel secreg = new JLabel("enter second register");
- JLabel thirdreg = new JLabel("enter third register");
- JTextField noofinst = new JTextField();
- JTextField tfirstinst = new JTextField();
- JTextField tfirstreg = new JTextField();
- JTextField tsecreg= new JTextField();
- JTextField tthirdreg = new JTextField();
- noofinst.setBounds(0, 100, 300, 100);
- firstinst.setBounds(0, 200, 300, 100);
- tfirstinst.setBounds(0, 300, 300, 100);
- firstreg.setBounds(0, 400, 300, 100);
- tfirstreg.setBounds(0, 500, 300, 100);
- secreg.setBounds(0, 600, 300, 100);
- tsecreg.setBounds(0, 700, 300, 100);
- thirdreg.setBounds(0, 800, 300, 100);
- tthirdreg.setBounds(0, 900, 300, 100);
- Container c = this.getContentPane();
- c.add(noofinst);
- c.add(numofinst);
- c.add(firstinst);
- c.add(tfirstinst);
- c.add(firstreg);
- c.add(tfirstreg);
- c.add(secreg);
- c.add(tsecreg);
- c.add(thirdreg);
- c.add(tthirdreg);
- this.setVisible(true);
- }
- }
- public static void main(String[] args) {
- mainframe mf = new mainframe();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement