Just add the text field to the NORTH
position of the default BorderLaoyout. Instead of this
JScrollPane scrollPane = new JScrollPane(table);
add(scrollPane);
Container cp = getContentPane();
cp.add(textFiled);
Just do this
JScrollPane scrollPane = new JScrollPane(table);
add(scrollPane, BorderLayout.CENTER);
add(textFiled, BordderLayout.NORTH);
Also why in the world are you adding enterText
into textFiled
twice. You may want to remove one of the.