Is there anyone to help me??why my code is not working? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is there anyone to help me??why my code is not working?

import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.sql.*; class coppyFirst_atm implements ActionListener{ Button bLogin=new Button(" LogIn"); Frame fr1=new Frame(); void interfaceUserPassword(){ fr1.setSize(350,280); fr1.setLayout(null); fr1.setVisible(true); fr1.setBackground(Color.gray); TextField tx1=new TextField(); tx1.setBounds(150,50,120,35); tx1.setBackground(Color.white); fr1.add(tx1); Label laUser=new Label(" Username"); laUser.setBounds(20,50,100,35); laUser.setBackground(Color.cyan); fr1.add(laUser); TextField tx2=new TextField(); tx2.setBounds(150,100,120,35); tx2.setBackground(Color.white); fr1.add(tx2); Label laPin=new Label(" Pin Number"); laPin.setBounds(20,100,100,35); laPin.setBackground(Color.cyan); fr1.add(laPin); bLogin.setBounds(110,160,100,35); bLogin.setBackground(Color.green); bLogin.addActionListener(this); fr1.add(bLogin); } public void actionperformed(ActionEvent e){ if(e.getSource()==bLogin){ Frame fr2= new Frame(); fr1.setVisible(false); fr2.setVisible(true); fr2.setSize(350,350); } } public static void main(String[]args){ coppyFirst_atm ob=new coppyFirst_atm(); ob.interfaceUserPassword(); } }

20th Mar 2017, 9:54 AM
Hana F. Abdulqadr
Hana F. Abdulqadr - avatar
2 Answers
0
it it throwing an error or just not displaying your window?
20th Mar 2017, 10:08 AM
LordHill
LordHill - avatar
0
When i run it,,an error appear(coppyFirt_atm is not abstract and dose not ovverride method actionperformed(action event)in Actionlistener )
20th Mar 2017, 10:17 AM
Hana F. Abdulqadr
Hana F. Abdulqadr - avatar