Set an EmptyBorder
around your JPanel
.
Example:
JPanel p =new JPanel();
p.setBorder(new EmptyBorder(10, 10, 10, 10));
More Related Contents:
- Make a object when pressed follow mouse pointer, java [closed]
- How to add an image to a JPanel?
- How to set a background picture in JPanel
- How do I change JPanel inside a JFrame on the fly?
- JPanel repaint issue
- paintComponent() vs paint() and JPanel vs Canvas in a paintbrush-type GUI
- How to draw in JPanel? (Swing/graphics Java)
- Rotate BufferedImage Inside JPanel
- animate JPanel (slide in) with timer
- Why is my JLabel not showing up
- Java Linux Terminal in JPanel
- How to repaint a JPanel after have drawn on it?
- Sending messages between two JPanel objects
- Background image for a jPanel not working
- Why does calling dispose() on Graphics object cause JPanel to not render any components
- Using addMouseListener() and paintComponent() for JPanel
- Replacing JPanel with JPanel in a JFrame
- FlowLayout on top of GridLayout not working
- Exporting a JPanel to an image
- Slide JPanel Content in a JForm on Java
- How to draw grid using swing class Java and detect mouse position when click and drag
- How to add JPanel by clicking JButton?
- Image resizing and displaying in a JPanel or a JLabel without loss of quality
- How do I draw on a JPanel from multiple outside classes?
- How to include custom panel with NetBeans GUI Builder?
- How to fit Image size to JFrame Size?
- CardLayout showing two panels, flashing
- add JMenuBar to a JPanel?
- What is the relation between ContentPane and JPanel?
- Can I add a component to a specific grid cell when a GridLayout is used?