Try calling somePanel.revalidate()
. That will tell the AWT that you have changed the component tree.
EDIT: Changed from invalidate
to revalidate
More Related Contents:
- Make a object when pressed follow mouse pointer, java [closed]
- Java: maintaining aspect ratio of JPanel background image
- Java: Difference between the setPreferredSize() and setSize() methods in components
- How do I change JPanel inside a JFrame on the fly?
- What does .pack() do?
- Adding JPanels from other classes to the cardLayout
- paintComponent() vs paint() and JPanel vs Canvas in a paintbrush-type GUI
- Rotate BufferedImage Inside JPanel
- Can’t a Swing component be added to multiple containers?
- animate JPanel (slide in) with timer
- Why is my JLabel not showing up
- Java Linux Terminal in JPanel
- 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
- Having images as background of JPanel
- Using addMouseListener() and paintComponent() for JPanel
- FlowLayout on top of GridLayout not working
- Java Swing – how to show a panel on top of another panel?
- Exporting a JPanel to an image
- How to draw grid using swing class Java and detect mouse position when click and drag
- How to add JPanel by clicking JButton?
- How do I draw an image to a JPanel or JFrame?
- Obtaining focus on a JPanel
- 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?