Sandar Khin 0 Newbie Poster

Hi all,
Pls help me .I want to make multile JLabel or JTextField with multiple Link in Marquee.I can do only one.Here is my code

import java.awt.*;
import java.io.IOException;
import java.util.*;
import javax.swing.*;
import java.awt.event.*;

public class MovingText extends JFrame implements ActionListener{
JLabel label;
JLabel label2;
JLabel label3;
public MovingText()
{
label = new JLabel( "Hello World,Where there is will there is& nbsp;a way");
//label2 = new JLabel(" ......Testing");
//label3 = new JLabel(label.getText().concat(label2.getText()));
getContentPane().add(label, BorderLayout.NORTH);
/*label.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
if(evt.getClickCount() > 0){
try {
Process pc = Runtime.getRuntime().exec("cmd.exe /c start http://www.iwebie.com");
} catch (IOException ex) {
System.out.println(ex.getMessage());
System.out.println();
}
}
}
});
label2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
if(evt.getClickCount() > 0){
try {
Process pc = Runtime.getRuntime().exec("cmd.exe /c start http://www.google.com");
} catch (IOException ex) {
System.out.println(ex.getMessage());
System.out.println();
}
}
}
});*/
javax.swing.Timer timer = new javax.swing.Timer(100, this);
timer.start();
//System.out.println("Label 3 "+label3.getText());
}
public void actionPerformed(ActionEvent e) {
String oldText = label.getText();
String newText = oldText.substring(1) + oldText.substring(0, 1);
label.setText( newText );
}
public static void main(String[] args) {
MovingText frame = new MovingText();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.setSize(300,100);
frame.setVisible(true);
}
}

I takes the times for many weeks about that.So Pls help me.Thank in advance.:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.