Dell Released

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, August 28, 2013

Trying to print a string character by character with delay between two character print

Posted on 12:20 PM by Unknown
Trying to print a string character by character with delay between two

character print



I've tried with code below. please guide me where i am wrong??? The

desired output is like..

m(delay)e(delay)s(delay)s(delay)a(delay)g(delay)e.

import java.util.*;

import java.applet.*;

import java.awt.*;

/*<applet code="MessageWithDelay" width=400 height=200>

</applet>*/

public class MessageWithDelay extends Applet implements Runnable {

Thread t;

//char msg[] ={"m","e","s","s","a","g","e"};

String str = "message";

Graphics bufferg;

Image buffer;

int counter=0,x=str.length(),i=0;;

public void init() {

//initializa the thread

t = new Thread(this);

t.start();

Dimension d = getSize();

buffer = createImage(d.width,d.height);

}

public void run() {

try {

while(true)

{

//requesting repaint

repaint();

if(counter==x)

{

Thread.sleep(200);

counter=0;

i=0;

}

else

{

Thread.sleep(400);

}

}

}

catch(Exception e) {

}

}

public void update(Graphics g) {

paint(g);

}

public void paint(Graphics g) {

if(bufferg == null) {

Dimension d = getSize();

bufferg.setColor(Color.green);

g.setFont(new Font("Comic Sans MS",Font.BOLD,36));

bufferg.drawString(str.charAt(i)+"",20,20);

counter++;

i+=1;

//update screen

g.drawImage(buffer,0,0,this);

}

}

}

I am working on command prompt and its giving me bunch of different

errors. I want to know why the errors occurring if anyone could explain me

by trying it. Thanx in advance.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Android - error opening file just created
    Android - error opening file just created I'm new to android developement and trying to do some file IO. Whenever I run this block of co...
  • Udated Streak 7 Manual & Quick Start Guide With Honeycomb
    For those of you who bought the Streak 7 before the Honeycomb 3.2 update, you have in your possession an out of date Manual & Quick Star...
  • Application or Object defined error - VBA Excel 2013
    Application or Object defined error - VBA Excel 2013 I want code to check one column of data for a condition ie: Range Qualification. If the...
  • Bouncing between "Adapter is detached" and "No wrapped connection" with HttpClient
    Bouncing between "Adapter is detached" and "No wrapped connection" with HttpClient So as i said i'm bouncing back an...
  • Frequent out of memory issues
    Frequent out of memory issues We are running web application with 6GB heap assigned to it. But, after some time, it is giving out of memory....
  • How to aggregate data without group by
    How to aggregate data without group by I am having a little bit of a situation here. The environment I have a database for series here. One ...
  • fanotify unable monitor entire system for FAN_OPEN_PERM event by multi-threaded program, and to ignore directories
    fanotify unable monitor entire system for FAN_OPEN_PERM event by multi-threaded program, and to ignore directories I want to monitor whole s...
  • A div that adapts to its background
    A div that adapts to its background Is it possible to make a div adapt to the img that its in the background? Clarification: I do not mean t...
  • Left-justified equations with left tags (so it looks like an enumeration)
    Left-justified equations with left tags (so it looks like an enumeration) I want to make a math enivornment (preferably a customized align/f...
  • candied mints storage and transporting long distance
    candied mints storage and transporting long distance I'm making mints for my nephew's wedding (containing powdered sugar, butter, wh...

Categories

  • Games
  • News
  • Streak 5
  • Streak 7
  • Tips

Blog Archive

  • ▼  2013 (124)
    • ▼  August (124)
      • Should I make multiple SQLite databases for better...
      • Difference between Nil and nil and Null in Objecti...
      • Cannot connect to SQL Server 2012
      • Android - error opening file just created
      • PHP SimpleXML doesn't output anything
      • Memory leak (igraph, watts.strogatz.game, get.all....
      • How do I position a div on top of another div
      • Updating foreign key references on the DbContext C...
      • Convert string to DateTime and format
      • call function on click outside of a particular div
      • OperationalError when inserting into sqlite 3 in P...
      • Trying to print a string character by character wi...
      • I need to make my JPanel resize dynamically as new...
      • How to retrieve images from cache memory?
      • how to add jscrollpane to jframe?
      • Query on how to Select Date before the latest Date...
      • Does archive size of tar, zip and rar effect the t...
      • How do I make a DOM object follow a circular path ...
      • how to use for loop for my issue
      • AngularJS - Pass variable from a controller & upda...
      • Windows 2012: how to make power button work in eve...
      • IN OBOUT grid, how to move from first grid to anot...
      • Am I using the form action correctly?
      • Increasing the font size of a webview conflict wit...
      • quicktags "link" button doesn't work, but all othe...
      • Cannot access local variables using systemtap
      • Remove/avoid adding target link to URL
      • Left-justified equations with left tags (so it loo...
      • [ Marriage & Divorce ] Open Question : My boyfrien...
      • livetv2pc)))WaTch (Rugby) Australia vs New Zealand...
      • The Google Visualization API Query Language: Query...
      • iOS 7 phone-number link doesn't work when webpage ...
      • Cross-browser textarea maxlength
      • candied mints storage and transporting long distance
      • how to convert objectHTML into html
      • Mellin transform definition
      • Multiple Google Calendars with one Google Cal ID
      • Dell PowerEdge 2950 PCIe Training Error -- No PCIe...
      • Reset Disk - Windows Storage Server 2012
      • Windows Phone 8 - Keeping background location trac...
      • Django forms design suggestiom
      • Magento Upgrade, getting error with tier prices fr...
      • Bouncing between "Adapter is detached" and "No wra...
      • How to create overlapping - not stacking - shapes ...
      • Enclosing capsules around list based arrays [on hold]
      • Identifying Switch case argument (Perl)
      • asp.net ModalPopupExtender not behaving properly
      • fanotify unable monitor entire system for FAN_OPEN...
      • Jquery UI datepicker inline "onclick" handler caus...
      • URL constantly results in a badbox
      • Split values over multiple rows with different del...
      • How to aggregate data without group by
      • Angular $scope.$watch on (for in... ) don't work
      • Using Modernizr to test browser support for css ca...
      • Content overlapping in navigation menu?
      • cls file - multiple files
      • Differences between "fortification nouns"
      • filtration on the cohomology of a complex
      • Problems with every aspect of facebook that involv...
      • Extract data from last line in a text file using PHP
      • How to properly provide data for ?
      • ConditionalPanel doesn't support variables with do...
      • Frequent out of memory issues
      • Undefine reference for libraries, so How could I f...
      • radio buttons checked with jquery not holding prop...
      • How to modify bash command to change permissions
      • header(Content-type: image/jpeg) not working
      • Removing smart quotes from an SQL server text column
      • Getting out of sync server response
      • thesis work" vs "thesis
      • php radio post wrong same value after submit
      • Several questions about trigonometry and functions
      • A div that adapts to its background
      • Why are there two different versions of the mean a...
      • Restore only some volumes from a multiOS system image
      • system of pde (solid mechanics)
      • Application or Object defined error - VBA Excel 2013
      • Deleting the last few revisions: SVN best practice
      • Choose blackberry 10 platform to use call logs, me...
      • Procedure or function usp_logout has too many argu...
      • how can i use combination of unix signals (like SI...
      • Basic Javascript Countdown Timer Taking Longer Tha...
      • WordPress Guest Author - How can I use custom fiel...
      • button to generate html delete method?
      • socket.io redis ECONNREFUSED
      • Can one http request call multiple css files?
      • .htaccess related codeigniter. why error 404 page ...
      • Undefined symbols error from static framework
      • XML Sitemap Generator for URL with 1.5 million pages?
      • How do I prevent Microsoft DNS from reporting vers...
      • Solve the equation for x, y and z: $\sqrt{x-y+z}=\...
      • A basic doubt on linear dependence of vectors
      • mysql charsets, can I perform the conversion in py...
      • Mirrors Edge video settings are locked
      • Receiving null messages on android, how to fix it?
      • changing an onEdit function to run onOpen
      • Handle Multiple Form tag in asp.net page?
      • Getting click event on parent page of button in frame
      • Fix column width with tabularx
      • best software to use to make a website
      • NSLog returns (null) when logging string from anot...
      • Add express middleware for param validations
      • R "object x not found error" in calling self-defin...
      • Android Application for Registration to a website
      • How to insert multiple Facebook comment boxes on o...
      • How can I group by the difference of a column betw...
      • for loop with two integers
      • Why is unsigned integer overflow defined behavior ...
      • Using multiple SELECT statements to narrow results
      • Android: Logout system and the android lifecycle
      • how to use font awesome in own css?
      • Nested Lists in Spring Expression Language
      • Live USB quit working...HELP :-)
      • Need help in drawGradientArea
      • django-ckeditor Image Browsing
      • C3P0 connection Pooling issues
      • Code keeps entering values into array backwards
      • Number of permutations with repeated objects.
      • How do I suspend a certain process when display is...
      • How to free Watch Houston Texans vs Minnesota Viki...
      • UPS Shipping required I get a new account ID and n...
      • Java concurrency - Is this efficient?
      • Are floated element really removed from normal htm...
      • How to implement Jquery Text Editor with Hindi Lan...
  • ►  2012 (6)
    • ►  February (2)
    • ►  January (4)
  • ►  2011 (10)
    • ►  December (1)
    • ►  November (2)
    • ►  October (7)
Powered by Blogger.

About Me

Unknown
View my complete profile