Weitere ähnliche Inhalte
Kürzlich hochgeladen (20)
Pingame
- 1. /* CODE COMPILED AND CREATED BY
SHALABH PAREEK
LECTURER
GEETANJALI INSTITUTE OF TECHNICAL STUDIES
UDAIPUR(RAJ.)
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class PinGame extends JFrame implements ActionListener
{
JTextField [] tf ;
JLabel [] tl;
JButton submit,clear;
JLabel lscore;
JTextField tfscore ;
String [] stf = {"X1","X2","RESET OUT","SOD","SID",
"TRAP","RST 7.5","RST 6.5","RST 5.5","INTR","INTA",
"AD0","AD1","AD2","AD3","AD4","AD5","AD6","AD7","VSS",
"A8","A9","A10","A11","A12","A13","A14","A15",
"S0","ALE","WR","RD","S1","IO/M","READY","RESET IN",
"CLK (OUT)","HLDA","HOLD","VCC" };
PinGame ()
{
super("Pin Diagram 8085");
setLayout(null);
setBounds(0,0,1100,750);
setBackground(Color.gray);
JLabel in1 = new JLabel("INSTRUCTIONS :");
JLabel in2 = new JLabel("1. ENTER NAME OF EACH PIN IN GIVEN
TEXTFIELD");
JLabel in3 = new JLabel("2. YOU WILL EARN ONE POINT FOR EVERY RIGHT
ANSWER");
JLabel in4 = new JLabel("3. NO NEGATIVE MARKING");
JLabel in5 = new JLabel("4. ENTER PIN NAMES IN UPPERCASE ONLY ");
JLabel in6 = new JLabel("5. WRITE ACTIVE LOW SIGNALS WITHOUT COMPLEMENT
SIGN ");
JLabel in7 = new JLabel("6. WHEN DONE CLICK ON SUBMIT TO GET RESULT");
in1.setBounds(550,10,400,80 );
in2.setBounds(550,50,400,80 );
in3.setBounds(550,90,400,80 );
in4.setBounds(550,130,400,80 );
- 2. in5.setBounds(550,170,400,80 );
in6.setBounds(550,210,400,80 );
in7.setBounds(550,250,400,80 );
add(in1);
add(in2);
add(in3);
add(in4);
add(in5);
add(in6);
add(in7);
Font f1 = new Font ("Bookman Old Style",Font.BOLD,16);
tf = new JTextField[40];
tl = new JLabel[40];
submit = new JButton("SUBMIT");
clear = new JButton("CLEAR");
lscore = new JLabel("YOU SCORED = " );
tfscore = new JTextField();
submit.setBounds(450,400,80,20 );
lscore.setBounds(600,400,120,20 );
tfscore.setBounds(750,400,80,20 );
clear.setBounds(450,500,80,20 );
add(submit);
add(lscore);
add(tfscore);
add(clear);
submit.addActionListener(this);
clear.addActionListener(this);
String[] sl = {"1","2","3","4","5","6","7","8","9","10",
"11","12","13","14","15","16","17","18","19","20",
"21","22","23","24","25","26","27","28","29","30",
"31","32","33","34","35","36","37","38","39","40"};
int tfx = 20, tfy = 10,length = 80,width = 28;
for(int i = 0; i<20;i++)
{
tf[i] = new JTextField();
tf[i].setBounds(tfx,tfy,length,width);
tfy = tfy + 30;
add(tf[i]);
- 3. }
tfx = 325;
for(int i = 20; i<40;i++)
{
tfy = tfy 30;
tf[i] = new JTextField();
tf[i].setBounds(tfx,tfy,length,width);
add(tf[i]);
}
for(int i = 0; i<40;i++)
{
tf[i].setFont(new Font ("Century Schoolbook",Font.BOLD,12));
}
int lx = 150, ly = 10,llength = 80,lwidth = 28;
for(int i = 0; i<20;i++)
{
tl[i] = new JLabel(sl[i]);
tl[i].setBounds(lx,ly,llength,lwidth);
ly = ly + 30;
add(tl[i]);
}
lx = 250;
for(int i = 20; i<40;i++)
{
ly = ly 30;
tl[i] = new JLabel(sl[i]);
tl[i].setBounds(lx,ly,llength,lwidth);
add(tl[i]);
}
addWindowListener(new END());
setVisible(true) ;
}
public static void main(String[] args)
{
new PinGame();
}