can anyone explain
publicclass ScrollingMessage
{
static String message ="this message scrolls with the aid " +
"of a timer from the javax.swing.Timer class . . . ";
staticint letterCount = 0;
publicstaticvoid main(String[] args)
{
final JTextField tf =new JTextField(30);
tf.setMargin(new Insets(0,10,0,10));
tf.setEditable(false);
tf.setFont(new Font("monospace", Font.PLAIN, 16));
tf.setText(message);
final String[] letters = message.split("(?<=[\\w\\d\\s])");
Timer timer =new Timer(250,new ActionListener()
{
publicvoid actionPerformed(ActionEvent e)
{
String text = tf.getText().substring(1) +
letters[letterCount++ % letters.length];
tf.setText(text);
}
});
timer.start();
JFrame f =new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(tf,"South");
f.setSize(300,150);
f.setLocationRelativeTo(null);
f.setVisible(true);
}
From the code above can anyone explain what this line does?final String[] letters = message.split("(?<=[\\w\\d\\s])");
secondly how do i use 1 string instead of 2 strings for the scrolltext and how can i make the text scroll from left to right? Hope anyone could give a help explaining. thanks alot.

