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.

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.

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

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

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?

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.