Screenshot:
The textfield
always worked fine, but suddenly was too small. You can still enter text, and when clicking the Print textJOptionPane.
I also tried both
JTextField tfld = new JTextField(10);
and
JTextField tfld = new JTextField("test adlfjsdlfjasdf");
but neither one helped.
try you use
txtfield.setPreferredSize(new Dimension(int,int));
it will take parameters for Dimension you can read this for further assistance