one often comes accross adventure games where a player can be moved around. One has the impression, that the background is moving and therefore the player itself is walking, a ship is flying or a car is driving.
But who to realize this within the paint() function?
I'm not sure I've fully undestood what you asked.
If you asked for a scrolling like Mario, R-Type or something like that I suggest you look for a tiled background. There's a lot of documents of the net for tiles map.
Basically you have an array with the number of tile. Each tile is an image of for example 16x16 pixels. If you assemble them, you'll have the background. While moving x,y position of the player in this array, you get the background moving (you just draw the correct portion of the background)