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.
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();
});