use a rectangle to tell what's visible. Make it the dimensions of the screen. You subtract it's x and y coordinates from the coordinates of images you want to draw, and you can tell if something's on the screen if the object's bounds interesects your screen rectangle. You don't need any Swing ****
I have a background image that I paint over each frame that I create withVolatileImage offImage = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().createCompatibleVolatileImage(width, height);
and in my game I create a Graphics2D object withg2d = (Graphics2D)offImage.getGraphics();
and I do all my drawing onto g2d. When I want offImage painted to the screen, I callgetGraphics().drawImage(offImage, 0, 0, null);
voila, no Swing :) All you need for getGraphics() to work is to be working in an Applet or a Frame.
for simple games when I do that I just say if this item is in the right panel, add on the x coordinate of the panel to anything I draw for it, so's to keep up with the placement of all my items on the panel.
For more complicated games, I'd make a separate class for the panel. When I call it's render() method I'd have it draw onto a BufferedImage of the dimenions of the panel, and then plop that on my screen. So all the panel's knowledge of pixel placement is relative to the panel, but you can handle the offset of the panel itself by choosing where you place that BufferedImage on the screen.