Question: Swing question

Ads

 
 
 

Share on Google+Share on Google+

samir
Swing question
1 Answer(s)      7 years ago
Posted in : Swing AWT
Ads
View Answers

September 24, 2009 at 5:08 PM


Hi Friend,

Try the following code:

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

public class MovingText extends JFrame implements ActionListener{
JLabel label;
JLabel label2;

public MovingText() {
label = new JLabel( "Hello World,Where there is will there is a way");
getContentPane().add(label, BorderLayout.NORTH);
javax.swing.Timer timer = new javax.swing.Timer(100, this);
timer.start();
}
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);
}
}

Thanks

Ads









Related Tutorials/Questions & Answers:
swing question
swing question  how to write multiple line text area in a single frame
swing question
swing question  please provide me a program with oracle conectivity in which it consist of a log in page. and when i clicked login it takes data from table(which contain username and password) and matches and give msg for login
Advertisements
Swing question - Swing AWT
Swing question  I want to move a string in JFrame similarily as done by marquee tag in HTML.The string should move from right to left. How can I do this?  Hi Friend, Try the following code: import java.awt.
swing question - Java Beginners
swing question  how i can create login form in java with password entering i can to next page only if password is correct i want to use java swing feature
java swing question - Java Beginners
java swing question  how i can create login form in java with password entering i can to next page only if password is correct i want to use java swing feature
Regarding My 3rd Question in Java - Swing AWT
Regarding My 3rd Question in Java  sir in Netbeans By default JTable Columns will appear Horizontal like Title1 Title2 Title3 Title4 in below these our data will appear so my question that is there any method
Java question - Swing AWT
){ Object obj1=null,obj2=null,obj3=null; String q=""; int i=table.getSelectedRow(); if(i==0){ counter1++; q=Integer.toString(counter1); } if(i==1){ counter2++; q=Integer.toString(counter2
SWING
SWING  A JAVA CODE OF MOVING TRAIN IN SWING
swing
swing  How to make swing component auto-resizable when JFrame resize
swing
swing  Write a java swing program to delete a selected record from a table
question
question  i want the code of multiplication of two numbers with swing
Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed
Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed
question
question  Sir, Please send me Java Swing source code for video streaming , it's very urgent
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
Question
Question   When there is an exception in my program how java runtime system handles
question
question  dear sir/madam my question is how to compare two text format in java..we are java beginners..so we need the complete source code for above mentioned question...we have to compare each and every word
question
question  Sir, If i have a frame with two button sign in and cancell using java swing .If i am clicking a sign in button using user name... the source code using Java Swing
question
question  Dear sir i had some typing mistake at previous question so its my humble request to let me know the steps to start the tomcat6 under the tomcat directory
question
scroll pane using java swing .If i am clicking a search button then i want... Swing
question
question  Sir, If i have a frame with one text field and one button search using java swing .If i am clicking a search button then i want... Swing   import java.io.*; import java.awt.*; import javax.swing.*; import
swing-awt - Swing AWT
swing-awt  Hi, Thanks for replying to my question...I'm getting some confusion to add action events in my application(Rich Text Editor).How to add action events? Thank U
java swing - Swing AWT
java swing  how i can insert multiple cive me exampleolumn and row in one JList in swing?plz g  Hi Friend, Please clarify your question. Thanks
question
question  Sir, If i have a frame with one text field and two button search and send using java swing .If i am clicking a search button then i want... using Java Swing   I think this will help you, try this package
question
question  Sir, how to write the following code in jsp , avoid swing components , please give me the following code in another method , iwant to avoid swing . /* * To change this template, choose Tools | Templates
question
question  Gud morning sir, I have asked u some question regarding jsp in saturaday for that i didnot find any answere in which u send me the some of the links.U have asked me the specify some details. There is a entity name
Question?
Question?  My question is how to: Add a menu bar to the program with a File menu. In the File menu, add a submenu (JMenuItem) called About. When the user clicks on the About menu item, display a JOptionPane message dialog
Use of Hyperlink in Swing - Swing AWT
the Java Swing and I have to create Hyperlink in the JTable cell so that if the user click on the Hyperlink it will open other window/screen/panel. My Question is: Is it possible to use Hypelink in java Swing. Please Help. Regards
swing/awt - Swing AWT
swing/awt  How to create richtexteditor using swings...?I'm very much new to swings....It's urgent.....Thank u...   hello read this book you get idea; JFC Swing Tutorial, The: A Guide to Constructing GUIs, Second
What is Swing?
What is Swing?  What is Java Swing? Where to get the tutorials of Swing? I am beginner in Java Swing programming and trying to find the tutorials of Swing. Tell me the urls to learn swing. Thanks   Hi, Swing is Java
Tutorials   
Java Spring Hibernate Struts Training Change JPanel background color from mouse entered/exit event JTable Pagination Jcombobox JAVA SWING how can i display a pdf file in a jtextarea Crop Image Code in Applet Crop Image Code in Applet Image Manipulation in Swing AWT Applet Ho to get virtual key code. how to show set of images continously using JScrollpane in java how to show set of images continously using JScrollpane in java How to connect on screen keyboard to system. How to connect on screen keyboard to system. query java client server program for playing video file(stored in folder in the same workspace) using swings java client server program for playing video file(stored in folder in the same workspace) using swings java client server program for playing video file(stored in folder in the same workspace) using swings java client server program for playing video file(stored in folder in the same workspace) using swings Download. how to open one Jframe from main method call Urgent requirement display shapes i am getting an error in adding a menu item to a menu. I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this Sliding window protocol how to update the value of jslider how to update the value of jslider how to update the value of jslider how to update the value of jslider how to update the value of jslider Jbutton in JTable cells program code java textfield problem swing retrieve data from database in java swing form using prev n next buttons retrieve data from database in java swing form using prev n next buttons How to close a frame on action event of a button from a different class ? searching the data swings for webnms Jpanel allignment pass data from java frame to file code for traffic control system simulation Bank Management System how to maKE Jcombox editable after saveing value init. i havei) aJTextField and one button. when place the cursor or enter anything in the test field then only button should be enabled.by default the button should be disabled. i havei) a jtable with few cloumns and few rows andii) one button. when place the cursor in any of the table's column cell. i need to enable the button.by default the button should be disabled. PDF Comparator i have JTextfield and JComboBox. there are several values in combobox.when i select a value from combobox how to make textfiled as a combobox. issue on jcombobox

Ads

 
Advertisement null

Ads