100分求高手帮帮我看看这个程序
/*
* Created on 2005-5-25
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/**
* @author Admin
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class WriteSign extends JApplet implements ActionListener{
JLabel numLabel,signLabel;
JTextField numField;
JTextArea signArea;
public void init()
{
Container container = getContentPane();
container.setLayout( new FlowLayout( ) );
numLabel = new JLabel( "NUM" );
numField = new JTextField( 15 );
numField.addActionListener( this );
container.add( numLabel );
container.add( numField );
signLabel = new JLabel( "the sign '@' is" );
signArea = new JTextArea( "",2,15 );
signArea.setEditable( false );
container.add( signLabel );
container.add( signArea );
}
public void actionPerformed( ActionEvent actionEvent )
{
int num = Integer.parseInt( actionEvent.getActionCommand() );
String output = "";
if (num >= 1 && num <= 25 )
{
numField.setText( Integer.toString( num ) );
for(int i = 0;i < num; i++ )
{
output += '@';
}
signArea.append( output );
}
else
signArea.append( "wrong number" );
}
}
程序打印'@'得不到num大于17时得@个数,我用eclipse,applet的好像窄了点,怎么实现分为2行把num大于17得@打印出来.