I'm assuming you're using the standard Java 2D API, not OpenGL.
In that case, you render your graphics to a buffer image first. Then, to render that image to the screen, you can either use a Graphics.drawImage call that allows resizing your buffered image:
public abstract boolean drawImage(Image img, // the buffer image
int dx1, int dy1, int dx2, int dy2, // 0, 0, screen.w, screen.h
int sx1, int sy1, int sx2, int sy2, // 0, 0, image.w, image.h
ImageObserver observer) // null is fine
or, if you want to have more control over the scaling algorithm, you can first convert the image to a second buffered image using the following method of the
public Image getScaledInstance(int width, int height, int hints)
Here, the parameter
hints is one of
See the API doc for details. For bigger games, you might want to keep an eye on performance doing these rescales, but for typical 8-bit resolutions you should probably be fine.