There are a number of issues
- You need to add the
JPanel
groupBoxEncryption
to the applicationJFrame
- Don't add the
textarea
to the frame - components can only have one parent component - As already mentioned, you're using
null
layout which doesnt size components - forget about not a layout manager. - As
JPanel
usesFlowLayout
by default, you need to overridegetPreferredSize
for the panelgroupBoxEncryption
. Better yet use a layout manager such asGridLayout
that automatically sizes the component
Example
JPanel groupBoxEncryption = new JPanel(new GridLayout());