Encontrar Errores
Publicado por Alex Rodríguez (2 intervenciones) el 13/06/2020 08:26:37
Hola! Necesito encontrar los errores de este código, gracias desde ya!
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
import javax.swing.*;
import java.awt.event.*;
import java.net.*;
publicclassIpFinderAextends JFrame implements {
JLabel l;
//JTextField tf;
JButton b;
IpFinderA(){
super("IP Finder Tool - Javatpoint");
l=new JLabel("Enter URL:");
l.setBounds();
tf=new JTextField();
tf.setBounds(50,100,200,20);
b=new JButton("Find IP");
b.setBounds(50,150,80,30);
b.addActionListener(this);
add(l);
add(tf);
add(b);
setSise(300,300);
setLayout(null);
setVisible(true);
}
publicvoid actionPerformed(ActionEvent ){ //falta el nombredelparametro
String url=tf.getText();
//try {
InetAddress ia=InetAddress.getByName(url);
String ip=ia.getHostAddress();
JOptionPanel.showMessageDialog(this,ip);
} catch (UnknownHostException e1) {
JOptionPane.showMessageDialog(this,e1.toString());
}
}
publicstaticvoid main(String[] args) {
new IpFinderA();
}
}
Valora esta pregunta


0