In the below example, how can I get the JPanel to take up all of the JFrame? I set the preferred size to 800x420 but it only actually fills 792x391. import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.image.BufferStrategy; import javax.swing.JFrame; import javax.swing.JPanel; public class BSTest extends JFrame {     BufferStrategy bs;     DrawPanel panel = new DrawPanel();     public BSTest() {         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         setLayout(new BorderLayout());   // edited line         setVisible(true);         setSize(800,420);         setLocationRelativeTo(null);         setIgnoreRepaint(true);         createBufferStrategy(2);         bs = getBufferStrategy();         panel.setIgnoreRepaint(true);         panel.setPreferredSize(new Dimension(800,420));         add(panel, BorderLayout.CENTER);     // edited line         panel.drawStuff();     }     public class DrawPanel extends JPanel {         public void drawStu...
Cisco Certified Network Associate Exam,640-802 CCNA All Answers ~100/100. Daily update