Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anyway to "pack" a JPanel?

Is there any thing I can do to make my JPanel pack like a JFrame, or do something like that. I want to do this instead of giving it dimensions. Please comment if any addition info is needed. Thanks.

like image 333
MattS Avatar asked Oct 06 '14 00:10

MattS


1 Answers

Please try JPanel.updateUI and let me know if that helps.

You should make GUI calls in the Event Dispatcher Thread:

EventQueue.invokeLater(() -> {
    someJPanel.updateUI();
});
like image 124
georges abitbol Avatar answered Sep 21 '22 12:09

georges abitbol