I started a few days ago to program with swing and I got now an insoluble problem.
I want to move the red graphic from a position a to any other position b.
it should move and not telepot.
It would be great if you could help me.
7. Painting method overrides are strictly for painting. Not for constructing components, not for showing another window, not for loading resources, not for application logic. Remember that you have absolutely no control over how often or how many times a painting method is executed.
There are no new questions, but there may be new answers.
Paul, do you have an answer to this? I see you didn't even return to that earlier thread. When people give you advice on a forum , they expect that the advice will be applied or at least discussed. Otherwise it's just a waste of time.
Please prove to me that I haven't wasted my time critiquing your code.
Paul, I'm sure your English is just fine for discussing code here. But it is common for beginners to find that their first attempt at writing a Swing program is a mess. You are not alone -- almost everybody does that. It's just that Swing somehow finds all of the things you aren't very good at, and exposes them mercilessly.
So at this point I think you would be better off to temporarily stop trying to make progress with what you have, and fix the problems that the others have already pointed out. In English we say "Don't put lipstick on a pig"... probably you have a similar expression in your native language.