0

Ok, well there is the problem: Java 1.4.2

Auto-boxing was introduced in 1.5. Without auto-boxing, the compiler doesn't convert primitive variables to their object wrappers, like Integer, automatically. You have to create those object instances yourself: new Integer(yourInt) Java 1.5 was officially at End-of-life status in 2009. You (meaning your class most likely) need to use a version of Java that is still supported. There is absolutely no reason at all to still be teaching students with anything prior to Java 1.5. Java 6.0 has been out since 2005.

Edited by Ezzaral: n/a

0

You need Java 1.5 or later for the compiler to handle automatic conversion between int and Integer to make that code work. More seriously you are using a version that is many years out of date, with none of the latest security updates. For reasons of security you should update to a current version of Java immediately.

0

but thats all there is, they "sun microsystems or whatever" hasent updated the program since 2002 apparently, so what program should i use, and it should be free, of course i have to ask my teachers permission

0

Oracle acquired the whole deal. Latest update was a few weeks ago. Current version is 1.7.something. Google it.

umm, to tell you the truth, i cant find another update of ready to program ide, can you post a link please?

0

This is really not a difficult problem

pButtonarray [x] [row].putClientProperty("x",x);
pButtonarray [x] [row].putClientProperty("row",row);
pButtonarray [x] [row].addActionListener (this);

public void actionPerformed(ActionEvent e) {
    JButton btn = (JButton)e.getSource();
    System.out.println("clicked x " + btn.getClientProperty("x") 
      + ",row " + btn.getClientProperty("row"));
} 

end-quote

Ok, so finally understand, its my java version, thats why nobody understands any of my errors, but atm my school doesant want to install a new program on the server atm, too busy, and the course is almost done, im doing it via amdec.

to fix my problem i just used

pButtonarray [x] [row].putClientProperty("x",new Integer (x));
pButtonarray [x] [row].putClientProperty("row",new Integer (row));
pButtonarray [x] [row].addActionListener (this);

thanks alot

Edited by mike_2000_17: Fixed formatting

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.