danke, so funktioniert es einigermaßen.
Code
//loop every step to destinationfor(int x = comp.getBounds().x, y = comp.getBounds().y;
(comp.getBounds().x > destX && x > destX) || (comp.getBounds().x < destX && x < destX) ||
(comp.getBounds().y > destY && y > destY) || (comp.getBounds().y < destY && y < destY) ;)
{
// set step bounds
comp.setBounds(x, y, comp.getPreferredSize().width, comp.getPreferredSize().height);
comp.repaint();
// in- or decrease x and y
if(comp.getBounds().x > destX) x--; else x += 1;
if(comp.getBounds().y > destY) y--; else y += 1;
// let thread sleep a second
try { Thread.sleep(1); }
catch(InterruptedException err) {}
}
Alles anzeigen
allerdings werde ich noch einbauen, dass der thread bei vorzeitiger umpositionierung gestoppt wird, so dass die components nicht "herumzittern".