Ticker or Morquee
Hi,
I am developing a Stocks Application. For my requirements, I have to add a Ticker(Moving Text) in Jlabel. I will get array of values at runtime. I have to show the values in Jlabel. I implemented the code somehow. But I got stuck to get the values at runtime. Please give me a suggestion or example code to execute further.
This is the code what i have written now
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.JFrame;
import javax.swing.JLabel;
* @author Sathiq.Ali
public class Tickering extends JLabel implements Runnable{
Font f=new Font("TimesRoman",Font.BOLD,24);
int X=300;
Thread runner;
String strMessage;
int idelay;
public Tickering(String str,int iDelay){
strMessage = str;
idelay = iDelay;
if(runner==null){
runner=new Thread(this);
runner.start();}
/* (non-Javadoc)
* @see java.lang.Runnable#run()
public void run() {
// TODO Auto-generated method stub
while(true){
repaint();
try{Thread.sleep(idelay);}
catch(InterruptedException e) {}
public void paint(Graphics g){
g.setFont(f);
g.drawString(strMessage,X,100);
X--;
if(X<-500)
X=300;
Thanx in Advance
Hi,
I come with some sort of solutions which i want to share with u people. But still I need to refine the code. Here I hardcoded the String Array and I used this. Instead of that How can i get the String[] at runtime(i.e To get Updated Array every time)?. Please Give me a Suggestion or alter the code and show me the way
below i added the code what i written now
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.Box;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class TickerTesting extends JFrame
JFrame tickerFrame;
JPanel tickerpanel;
public TickerTesting ()
tickerFrame = new JFrame("Ticker");
tickerFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
tickerFrame.setSize(new Dimension(120, 40));
tickerFrame.getContentPane().add(new Ticker(getTexts()) , BorderLayout.CENTER);
tickerFrame.pack();
tickerFrame.setVisible(true);
private String[] getTexts ()
String[] array = new String[]{"wipro","tcs","craness","infosys","hcl"};
return array ;
private class Ticker extends JPanel
{ //private JPanel panel;
private boolean paused;
public Ticker (String[] texts)
MouseListener listener = new MouseAdapter ()
public void mouseEntered (MouseEvent event)
paused = true;
public void mouseExited (MouseEvent event)
paused = false;
addMouseListener (listener);
tickerpanel = new JPanel ();
tickerpanel.addMouseListener (listener);
//tickerpanel.setLayout (new BoxLayout (tickerpanel, BoxLayout.X_AXIS));
for( int i = 0; i < texts.length; i ++ )
if( i > 0 )
tickerpanel.add (Box.createHorizontalStrut (20));
TickerLabel link = new TickerLabel (texts);
link.updateUI();
// link.addMouseListener (listener);
tickerpanel.add (link);
tickerpanel.setLocation (0, 0);
tickerpanel.setSize (tickerpanel.getPreferredSize ());
// //setLayout (null);
add (tickerpanel);
paused = false;
new Thread (new Runnable ()
public void run ()
while( true )
if( ! paused )
int x = tickerpanel.getX () - 1;
if( x < -tickerpanel.getWidth () )
x = getWidth ();
tickerpanel.setLocation (x, 0);
try
Thread.sleep (25);
catch( InterruptedException exception )
}).start ();
public Dimension getPreferredSize ()
Dimension preferredSizeOfPanel = tickerpanel.getPreferredSize ();
return new Dimension (preferredSizeOfPanel.width / 2, preferredSizeOfPanel.height);
class TickerLabel extends JLabel
public TickerLabel (final String text)
setText (text);
setForeground (Color.BLUE);
public static void main(String[] args)
javax.swing.SwingUtilities.invokeLater(new Runnable()
public void run()
TickerTesting ticker = new TickerTesting();
Similar Messages
-
Hi there, I am trying to connect to my server at work from home using a vpn connection. It connects fine and the time ticks along, but when i click go - connect to server, it comes up with connection failed. Please help!
... when i click go - connect to server, it comes up with connection failed.
If you're trying to connect to a Bonjour server on the remote network, that won't work over a layer 3 VPN. Use something like Hamachi or one of the SSH-tunnelling Bonjour proxy apps for that. -
Open commitments though Delivery complition ticked for PO.
Dear Experts,
I am facing a very strange issue.
We have a PO with 10 line items all items are alike except line item 9/10 where unit of measure is EA (each) and for others it is D (days). (account assignment catagory as Project, in the account assignment WBS element, Commitment item, Funds center, Fund are maintained, and it is same for all line items),
All the items are ticked for del.complition. So apperantly these items should not appear as open commitments in Funds consumption report,
First Eights lines (which have unit of measure as D) are not appearing in Fund consumption report but the last two line items 9/10 (with unit as EA) are appearing as open commitment in Funds consumption report.
I just changed the unit of measure of line item 8/9 to D from EA and saved the PO. After this i run the Funds consumption report and to my surprise the line items 8/9 are not appearing as open commitments.
I am not getting how come Unit of measure is playing role in Funds consumption.
Can somebody help me understand.
Best Regards
abhijitHi,
This reply is more of a guess work than otherwise:
Commitment seems to be created with unit of measure as D, possibly because that is the base unit of measure. EA could be alternate unit of measure which is entered in the PO. When you set delivery completion indicator, commitment is removed to the extend of EA rates (reason note known - possibly due to corrections in PO subsequently from D to EA. You can check the PO change history in this regard)
To further understand the issue, you can verify the value of commitment with D & EA from table COOI by passing the object number with and without delivery completion indicator. Alternatively, you can use transaction RKACSHOW to see the changes in commitment with differing units of measure and with / without delivery completion indicator.
Please post the results after trying out.
Muraleedharan.R -
How do I find and clear all ticked Stop Times in music tracks?
I have lots of music tracks which have the Stop Time ticked under the Options tab in Get Info. I don't know why they are ticked as I didn't do it, but now I want to clear them all as it causes tunes to stop abruptly in playback. I've looked for a script that would do this, but no luck. If there's no available script, perhaps if I could at least find all of the songs with Stop Time ticked, that would be a start. Does anyone either know of a way to clear all ticked Stop Times, or at least create a playlist of all songs with Stop Time ticked? If anyone knows why Stop Time gets ticked for some songs and not others, that would also be useful information. Thanks in advance.
barney97,
Maybe this script in can be of help:
tell application "iTunes"
if selection is not {} then
set sel to selection
repeat with this_track in selection
try
set finish of this_track to 1000
end try
end repeat
display dialog "Done!" buttons {"Thanks"} default button 1 giving up after 5
end if
end tell
Replace the "1000" with the number of seconds of your longest track, compile and run the script. The script tries to set the Stop Time to 1000 seconds. If your tracks are shorter in duration, the Stop times just will be cleared.
Run Script Editor (in ./Applications/Applescript) and copy the script (grey block above) to it.
Click the 'Compile' button and save it as a script in ./Library/iTunes/Scripts.
It will then appear in the Script menu in iTunes.
Next, select all tracks in your Music Library (Command-A) and run the script.
It's not a very elegant solution, but it works.
If anyone knows why Stop Time gets ticked for some songs and not others, that would also be useful information.
I can't tell you that. I've never experienced a phenomenon like that.
Maybe some iTunes related Widget or iTunes supporting application is responsible for that.
Hope this helps.
M
17' iMac 800 MHz, 768 MB RAM, 200 GB HD, DL burner Mac OS X (10.4.9) iTunes 7.2 -
I have a 2005 Jaguar xj8. When I tried to upgrade my 3gs to a 4g two years ago, I got a ticking noise in the speaker and no one on the other end could hear me. I had to go back to a 3gs. My phone is shot and I need to upgrade. Has there been a fix to the problem? Apple told me there was some sort of interference with the airbag system. Jaguar was totally unhelpful.
Hi Labjock,
Welcome to the Support Communities!
The article below may be able to help you with this.
iPhone: Microphone issues
http://support.apple.com/kb/ts5183
Cheers,
- Judy -
Splitting Column Data in a Ticker View
Hi All,
How to split the column data into Rows rather in a Single Row in a Ticker View?
I have created a Request with 3 columns viz., Emp ID, EName and Salary. In Ticker View, diplaying the data in 3 rows. But, I would like to display the data as we see in a Table Format i.e.,
1 John 10000
2 Allen 15000
Instead of
1 2
John Allen
10000 15000
Thanks,
-VencyHi,
Thanks for giving Reply.
I knew that we can use HTML tags. I have done with Creating Table and used @{Column_Number} in Row Format.
<Table><tr><td>@2</td></tr><tr><td>@3</td></tr></Table>
Here, @2 is a Second Column Data is occupying only one row i.e., displaying John Allen. But I need to display Allen in the next line as I gave the example in the previous post. I am not getting the way How can I Split that @2 into multiple rows.
Is you are expecting me to do in other way? please suggest..
Thank You,
-Vency -
Data Mart Status of the request is not ticked
Hello Everybody,
I am the first time to deal with BW.
After I loaded the data to the ODS, the request in the manage data view was not ticked as the others although the job was completed successfully.
Does anyone can help?
Many Thanks
F-B-IHi,
have you deleted the data mart status in ods .
u need to follow these steps
1, if you chenged the status to red no need to delete the datamart status in ods .you can load the data from ods to infocube.
2, if the status green and need to delete the datamart symbol in ods.
regards
sivaraju -
In Icloud on my imac I can't see my "numbers" icon which i need to select "tick" to transfer data to my other devices via icloud. any ideas why it's not showing up?
You have to do it app wise, which means that the icon won't show up in settings, but you will be able to move files from your local drive to iCloud via the Numbers app (move... > choose the iCloud option).
It requires that you set up the same iCloud account on all your devices and that you have the latest version of Numbers on all your devices as well. -
Dialogue tick boxes un-hiding all fields, not just the ones where value has changed to true
I am hoping someone can help me make what I want to happen, happen if certain check boxes are ticked withing the dialogue box
right now I can see on the console print that the tick box turns the value from false to true but the OK button is also un-hiding all my fields rather than just the ones where the value has turned to true. What am I missing here
//Create a Dialogue box for staff to state how many of the account owners are in branch in order for the names to show in the signing section
var Signors =
result:"cancel",
DoDialog: function(){return app.execDialog(this);},
bChk2:false,
bChk3:false,
bChk4:false,
bChk5:false,
initialize: function(dialog)
var dlgInit =
"Chk2": this.bChk2,
"Chk3": this.bChk3,
"Chk4": this.bChk4,
dialog.load(dlgInit);
commit: function(dialog)
var oRslt = dialog.store();
this.bChk2 = oRslt["Chk2"];
this.bChk3 = oRslt["Chk3"];
this.bChk4 = oRslt["Chk4"];
description:
name: "Signors",
elements:
type: "view",
elements:
type: "view",
char_height: 10,
elements:
type: "static_text",
item_id: "stat",
name: "Who is here to sign:",
char_width: 15,
alignment: "align_fill",
font: "dialog",
type: "view",
char_width: 8,
char_height: 8,
align_children: "align_top",
elements:
type: "view",
char_width: 8,
char_height: 8,
elements:
type: "check_box",
item_id: "Chk2",
name: "Primary Applicant",
type: "check_box",
item_id: "Chk3",
name: "Associate 1",
type: "check_box",
item_id: "Chk4",
name: "Associate 2",
type: "ok_cancel",
// did the value change when ticked - lets check
Signors.bChk2 = false;
Signors.bChk3 = false;
Signors.bChk4 = false;
if("ok" == Signors.DoDialog())
if (Signors.bChk2 = true)
getField("Signor1").hidden = false;
getField("Staff1").hidden = false;
getField("Date1").hidden = false;
getField("Date2").hidden = false;
if (Signors.bChk3 = true)
getField("Signor2").hidden = false;
getField("Staff2").hidden = false;
getField("Date3").hidden = false;
getField("Date4").hidden = false;
if (Signors.bChk4 = true)
getField("Signor3").hidden = false;
getField("Staff3").hidden = false;
getField("Date5").hidden = false;
getField("Date6").hidden = false;
console.println("Chk2:" + Signors.bChk2);
console.println("Chk3:" + Signors.bChk3);
console.println("Chk4:" + Signors.bChk4);
console.println("Chk5:" + Signors.bChk5);
//console.println shows if bChk.. is true or false
console.println("Chk2:" + Signors.bChk2);
console.println("Chk3:" + Signors.bChk3);
console.println("Chk4:" + Signors.bChk4);
console.println("Chk5:" + Signors.bChk5);
//Yeah, confirmed values have changed, now show fields based on staff input
//was primary applicant ticked
doWhatIWant: function(results) {
if (results [Signors.bChk2] = true)
getField("Signor1").hidden = false;
getField("Staff1").hidden = false;
getField("Date1").hidden = false;
getField("Date2").hidden = false;
//was Associate 1 ticked
if (results [Signors.bChk3] = true)
getField("Signor2").hidden = false;
getField("Staff2").hidden = false;
getField("Date3").hidden = false;
getField("Date4").hidden = false;
//was Associate 2 ticked
if (Signors.bChk4 = true)
getField("Signor3").hidden = false;
if (Signors.bChk4 = true)
("Staff3").hidden = false;
if (Signors.bChk4 = true)
("Date5").hidden = false;
if (Signors.bChk4 = true)
("Date6").hidden = false;You're missing some curly brackets, using the incorrect equality operator, and using the long deprecated field.hidden property. Try this:
if ("ok" == Signors.DoDialog()) {
if (Signors.bChk2) {
getField("Signor1").display = display.visible;
getField("Staff1").display = display.visible;
getField("Date1").display = display.visible;
getField("Date2").display = display.visible;
if (Signors.bChk3) {
getField("Signor2").display = display.visible;
getField("Staff2").display = display.visible;
getField("Date3").display = display.visible;
getField("Date4").display = display.visible;
if (Signors.bChk4) {
getField("Signor3").display = display.visible;
getField("Staff3").display = display.visible;
getField("Date5").display = display.visible;
getField("Date6").display = display.visible;
console.println("Chk2:" + Signors.bChk2);
console.println("Chk3:" + Signors.bChk3);
console.println("Chk4:" + Signors.bChk4);
console.println("Chk5:" + Signors.bChk5);
I don't know if that will deal with all of the problems, but it's a good start. -
Hi, I am trying to get my voice memos from my iPhone 3GS to my MacBook Pro via iTunes and it is not working. I have ticked sync music in the music tab of the iPhone device and the include voice memos box is also ticked. So, apparently this should work, but there is no sign of the voice memos in iTunes or in the iTunes folder in the finder window. Any ideas much appreciated! :-) Thank you.
I've always had the "Include Voice Memos" option selected. I think that only pertains to syncing voice memos from iTunes to the iPhone after it has been copied to iTunes. It has to be the new OS/iTunes not communicating that new memos have been recorded. For some reason they won't sync when I want them to, and then a few syncs later they magically appear.
By the way, I'm VERY comfortable with the iTunes and iPhone systems. I've been using iTunes for 5 years, and I've been recording class lectures with the iPhone voice memo app (and another app) for a couple years. It's not an error of not seeing that the memos were added; they don't exist in my library or music folders.
JUST OUT OF CURIOSITY, POST WHICH FIRMWARE YOU ARE RUNNING EXACTLY!!!
I'm on an iPhone 4, running firmware 4.0.1 -
ipod nano 3rd gen - tracks (whole albums) have disappeared from ipod but are showing ticked in itunes library and ipod is synched, have bought tracks from itunes since this happened and they are fine, any help please
You may have transferred all your songs, but your iPad is seeing the library as a different entity.
The following article(s) may help you.
Moving your iTunes library to a new computer -
Ok so, my itunes version is up to date, and I've located my itunes media folder... However, newly purchsed songs are not being backed up to the media folder, despite all the right options being ticked in the preferences box. This is immensly frustrating as I cannot back up my itunes library to a separate hard drive. Why is this happening and how can I fix it?
iTunes stores media in the location set in preferences. If you have changed things then this won't necessarily be the same place it puts the library file and other files that also need to be backed up.
If you are content to have everything in one location then I suggest you consolidate it all into one place. Note this copies files, it doesn't move them, so you need ot make sure you have sufficient hard drive space wherever you select.
iTunes for Mac: Moving your iTunes Media folder - http://support.apple.com/kb/ht1449
How to Consolidate Your iTunes Library and Keep It Organized - http://www.switched.com/2010/11/02/itunes-consolidate-library-keep-organized/
Technically you don't have to have it all in one location to back up. You just need to make sure you have gotten everything. I used to have iTunes on two separate drives but I would just make sure each drive was backed up 100% and I would know it was all backed up. -
Key Figure Summation in Result Row with Cumulation Ticked
Hi,
I have a Bex question regarding the summation rows.
I need a Year To Date amount and a Period To Date amount in the report. However, there is no Year To Date key figure available in the cube. So in order to calculate YTD, I'm using the PTD key figure and have Cumulated box ticked mark in Bex.
All looks fine across columns per Vendor. But the results row for the Cumulative Balance is always equal to the results row for Period Balances. I believe this is because the same key figure is used, and it is only reading the amounts in the cube - not the ones calculated on the fly.
Does anyone know how to correct the results row for a cumulated key figure?
Regards,
RhonnieYou have to create two restricted KF; one is PTD restricted to period; the second is PTD restricted in a period range from 01.yyyy to current period.
Hope it helps.
Regards -
This has now been ongoing for over a month - the lastest software release hasn't fixed it.
I can import music from CDs - the tracks are ticked for synching and all the associated rigmarole is correct.
Problem is when I synch, apps go across but imported music doesn't. It just gets to step 5 - waiting for changes to be applied - and then does nothing until it eventually finishes synching but no music has come across.
Same issue on my iphone.
I have looked at some solutions on forums but they seem complicated and I don't understand why apple haven't yet fixed this (or why you can't contact them). Seems a basic fundamental service that they are not supplying.
Having spoken to people in the family, its seems I'm not laone with this problem (unless you have a mac......)I had this same problem with my new MBP 15", but only with the USB port on the left side. The USB port on the right side worked fine. Perhaps the ports on the left don't have enough signal energy for the iPhone.
Anyway, try using a different USB port, and if that doesn't work, perhaps you could try a powered USB hub. -
Macbook not booting, faint ticking noise?
Hi there, I'm hoping you guys can give me a few pointers here. I have a mid 2007 black 13" Macbook that I have been having problems with. There have been two previous issues which may or may not be related.
Over the last three years, this Macbook has eaten through five HDD's. After finally getting fed up of this, I wondered if perhaps somehow I was to blame, maybe without realising I was putting it down on the desk a bit too hard or something, so when the most recent failure came, (approx six months ago) I bit the bullet and bought myself an SSD and all now seems to be well on the storage front.
Around the same time as the first HDD failure, came random shutdowns, without warning, what appeared to be complete power failures. I also noticed the X symbok in the battery indicator. These initially were fairly frequent but eventually subsided, along with the X symbol, but always seemed to rear up again, in times a heavy use, and were more often than not followed by HDD failure.
Now, the current issue is that yesterday, I started experiencing these power failures again, hoping to myself, I turned the machine back on. Upon logging in, the fan spun up to max, so, checking activity monitor, I found that spotlight indexing, was taking up 148%CPU and this seemed to be the cause of the shutdowns.
I left the machine to cool down for a few hours, booted it up, let spotlight finish indexing, and all was well for about 3 hours. Then came another shutdown.
This time, there was a reluctance to boot. The DVD drive made its usual noise, the sleep light glowed on, and then everything died. I tried again, same result, I tried a third time, and was greeted with the all to familiar, 'no boot media' icon (Folder with ?? flashing). Frustrated at the possible death of my SSD I turned the machine off and let it be.
Later on, I gave it one last try, hoping beyonnd hope, and lo and behold, it booted with no problem. When I logged in, I noticed the 'X' in the battery indicator once more, and spotlight started indexing again, fearing this would cause more shutdowns, I temporarily disabled indexing via terminal. All was well for a couple of hours, I turned my machine off, and went to bed.
I came down this morning, tried to turn on my Macbook, nothing. Tried again, still nothing. magsafe is plugged in w/ green light, battery shows full charge with or without magsafe plugged in, then I heard a faint ticking noise from the machine, on the logic board somewhere while the power button was pressed. it's somewhere around the 'W' on the keyboard. I have read that it could possibly be a shorted inductor on the logic board. Is there any chance it could be something a little more replaceable?
I'm hoping against hope here, as if it is the logic board, it may be time to retire the old beasty.
Cheers in anticipation,
AI was indeed looking into getting a mainboard for my old MacBook. I found a place where I was told, they will order it and replace it for me... the 'piece' never came to its destination ... after being almost 4months without computer, I decided to make the plunge and got a new one. After thinking, even if you found a 'reclaimed one' it may solve your problem just temporarly. If I were you, I would rather make a downpayment and get a financing on a new machine - you will be good to go for at least 6 or 7years again (with the new technology). Now, if you do not want to 'loose your money' you may wanna consider to resell your Device after a 1y1/2 or 2year, which permits you to get money back and stay 'in' the iDevices.
Maybe you are looking for
-
Opening a .swf in a separate window
Can anyone tell me the correct syntax to use when trying to have an .swf open from a button in the main swf? The button already has some animation and rollover features and I just wnated to add that on the mouse release (or down) I want to launch the
-
I can play audio files in iTunes but I can't play downloaded tv shows or movies. Everytime I try to play them, iTunes stops working and closes. Any information will help.
-
I'm the unhappy owner of four ipods (1 mini, 2 photos, and 1 video). After 36 hours of stress, anger, and being down right ****** off, I've discovered, by myself, that my Ipod photos do not snyc with itunes 6. I have tried everthing, even talked to t
-
Want to display GL account balances in currency other than display currency
I am facing one problem..I want to display the balances of GL account in USD but display is in EURO.How can I display it in USD?
-
Difference between Cofiguration and Customzing
Hi, What's the difference between Cofiguration and Customzing. BR Govind