> How do I fix my java code?

How do I fix my java code?

Posted at: 2014-12-18 
for(int l=1;l<=text.length()+8;l++){

System.out.print("*");

I want to make it so the user can type a word and and that word gets printed along with a line of stars. For example if the user typed text then the output would be:

****

text

What I want is to add 4 stars on either side and 2 lines at the ends so it looks like this

************

| text |

Also the words should be in the middle. How do I modify my program so it does that?

Here's the code that prints the stars:

for(int l=1;l<=text.length();l++){

System.out.print("*");

It prints the same amount of stars for the number of letters in the word but I want to add 4 stars on each side.