evo kako izgleda moj code , moze li mi neko reci gde je greska ?
10x
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class textbox extends JFrame
{
private JTextField name = new JTextField(12);
private JTextField message = new JTextField(40);
private textbox()
{
message.setEditable(false);
JButton enter = new JButton("Dalje");
enter.addActionListener(new action());
JPanel p = new JPanel();
p.setLayout(new FlowLayout());
p.add(new JLabel("Entré votre Prenom"));
p.add(name);
p.add(enter);
p.add(message);
this.setContentPane(p);
}
public static void main(String[] agruments)
{
textbox sal = new textbox();
sal.setTitle("Text-Box");
sal.setSize(550,150);
sal.show();
}
private class action implements ActionListener
{
public void actionPerformed(ActionEvent a)
{
String last = name.getText();
try {
if (last == null);
}
catch (Exception e) {
message.setText("Morate obavezno uneti vase ime ");
}
message.setText("Dobar dan gospodine, vase ime je " + last + " !" );
}
}
}
[Ovu poruku je menjao ctpaba dana 27.04.2005. u 23:51 GMT+1]
[Ovu poruku je menjao Milan Andjelkovic dana 28.04.2005. u 02:02 GMT+1]
www.ctpaba.org