Is there a way to "pack" JPanel?

Is there anything I can do to make JPanel packlook like a JFrame or do something like that. I want to do this instead of measuring. Please comment if you need more information. Thank.

+5
source share
2 answers

If I understand you correctly, your JPanel will not be automatically changed, fixed? In this case, you can use Component.validate (or JComponent.revalidate ())

0
source

Try JPanel.updateUI and let me know if that helps.

GUI :

EventQueue.invokeLater(() -> {
    someJPanel.updateUI();
});
0

All Articles