Java AWT application window padding
问题 I'm trying to build a simple AWT application in Java. I want all of the containers in the main window to be separated by bit. I can accomplish this by setting the Hgap and Vgap in the BorderLayout constructor (see below.) However, I can't figure out how to put a cap between the containers and the edges of the main window. How do I add a few pixels of padding to the main window? import java.awt.*; import java.applet.Applet; public class LayoutTest extends Applet { public void init() {