the MouseAdapter is a class, not an interface, so your can not use it with implements. You need to implement a MouseListener instead or create an anonymous instance of the MouseAdapter directly while adding.
Anyway, this is not what you should do. Implement an ActionListener and add it to the button instead.
Speaking of the button:
1 2
| int placering = y+i; Pladen.add(new JButton().putClientProperty(placering , Point(y,i))); |
is wrong, since this way you would add the
result of putClientProperty() to "pladen". Also you are missing a "new" statement before the Point, hence the "Cannot find symbol" message. The meanign of your "placering" variable is not clear to me. You won't gain anything by having a client property name, that's changing for every button. How do you know, which client property you would extract in the actionPerformed() method? Reread my post that suggests the putClientProperty().
Try
1 2 3 4
| JButton button= new JButton(); button.putClientProperty("location" , new Point(y,i)); button.addActionListener(this); pladen.add(button); |
Btw. you should adhere to some coding conventions:
- class and interface names should start with a capital letter (
public class PladenPanel extends JPanel implements ActionListener)
- method and variable names should start with a lower case letter (
JPanel pladen = new JPanel(new GridLayout(10,10));)
- name your interfaces, classes, methods and variables in english
All this is fairly basic stuff. I would advice to find some decent tutorials to teach you java and swing and follow them word by word until you have grasped the concepts.
Linking to your local drive will obviously not work

thank you for the answer.
I see now that there is some basic stuff i forgot to make, i were to fast on that ocation sry, and then there is some stuff that i am very unsercure in (especially swing) and i thank you for advecing me