Printer Problems (new thread)

I have an HP Photosmart 6150 that has been giving me more than a few headaches.  The first is that when ever I try to print a document, I get a message to replace the empty black ink cart.  This has happened with two new carts.  The gauge on both the printer and using the HP software show the cartridge as being full. 
I also usually have to go through and troubleshoot the printer because the "spooler service" is not available
This is happening with my Windows 7 operating system and the printer is attached to that PC via a USB port.
Any help would be appreciated.
Mark 

Hi jennmcmeow       ,
Can you answer a few questions, then hopefully I can help you with your printing problems.
1. Did you purchase A or XL sized supplies for your unit?
2. What type of documents are you printing, black text, mixed text and graphics, heavy colour, photos etc....
3. What time frame did you print the 50 pages over?
4. What are the estimated ink levels on your unit? From the Home screen, touch the ink icon to get estimated levels.
Many Thanks,
Francheska
Although I am an HP employee, I am speaking for myself and not for HP.

Similar Messages

  • Same problem -- new thread

    Hello,
    I have been reading through some of the other threads in the forum and it seems I'm having the same freezing problem with my 4th gen iPod, 50 gig, when connecting to Mac. Thought I'd post a new thread since the others are tremendously long and I have not yet found any answers.
    I have been accustomed to listening to the contents of my iPod through iTunes while at work, but one day the songs started skipping around and iTunes started to freeze. Thinking the problem was iTunes, since my iPod was working fine while not connected to the computer, I ignored it and just ejected the iPod. When I connected the iPod to my iBook G4 at home the same thing happened. iTunes froze, Finder froze, and I had to restart the iPod to disconnect it. After I did that the iPod would no longer show up on the desktop or in iTunes on either my iBook or work G4, so I restored it with the very latest iPod updater, thinking it would be a pain to put all my music back in, but it would be worth it in the end.
    Now when I try to add music to the iPod, the iPod itself eventually freezes mid-update, freezes iTunes and also the Finder and I have to start all over again. After restoring it a 4th time I got wise and decided to manually update. I have been adding 3 or 4 playists myself and then disconnecting for a while before reconnecting to add some more. This is a painstaking process, and I'm sure there is something going on here that is not my fault. The iPod has continued to work 100% normally when not connected to a Mac. The trouble seemed to appear out of nowhere, and I don't think it's a HD problem because of the fact that the iPod never freezes when not connected.
    It seems like many people with this gen. iPod are having similar problems, but I'd like to hear if someone thinks I may have done something to precipitate what is going on with my iPod. It's only a little over a year old and I see no reason why I should be having these Mac-connecting problems with it.
    4th Gen 50 gig click wheel   Mac OS X (10.4.6)  

    Turn off the PC.
    Open your MacBook.
    Open Applications > Utilities > AirPort Utility - click Manual Setup
    Click the AirPort Utility menu item in the upper left hand corner of the screen next to the Apple icon
    Click Check for Updates.
    If you have been updating your MacBook, you may already have the latest version of AirPort Utility. If so, you are all set. If you have an update available for AirPort Utility, go ahead and update it.
    Then open AirPort Utility again and click Manual Setup
    Click on the word "Status" to see if there are any messages or updates available for your AirPort Extreme. If yes, go head and update.
    In the future, use the MacBook to access your AirPort Extreme, not the PC.
    There is no need to "start over" unless you want to do everything again.
    Message was edited by: Bob Timmons

  • Printing problem-new HP Laserjet P2015 and VERY slow printing-

    I have a new HP Laserjet p2015, and while it does print, it is VERY slow—typically about 1 page per minute even for plain black-and-white Word documents. Much time spent with HP support, even got a new new machine… they're out of ideas and think it might be OS related…
    Where do I begin to troubleshoot this?
    Printer is connected directly to computer via USB.

    I have downloaded new drivers, removed and added the printer multiple times, etc. As I mentioned, I've spent a few hours with HP support, tried new USB cable, even got a new machine. They now believe it's something with my system.
    Any reason to believe that reinstalling my system software will help?
    By the way: Printing from Text Edit is not faster. Or if it is, not very. In any case, it's not a realistic solution

  • Thread Print problem

    I have an application which opens some Windows in a new Thread. I have a custom build Menu with a print command.
    The problem I'm facing is that when I want to print from the threaded Window I get a System.Invalidoperationexception:
    "The calling thread cannot access this object because a different thread owns it"
    I think the issue is that the visual is in the threaded window, but the Printdialog gets executed on main thread, as I understand this ???
    Sample App for testing and review at:
    Sample
    public static void StartPrint(Window win, string name)
                FrameworkElement vs = (FrameworkElement)ControlUtility.FindVisualChildByName<Grid>(win, "MainGrid");
    //Getting the error here
                Application.Current.Dispatcher.Invoke(new Action(() =>
                        PrintDialog pd = new PrintDialog();
                        if (pd.ShowDialog() == true)
                            pd.PrintVisual(vs, name);

    Yes.
    That's your problem.
    This bit
    Application.Current.Dispatcher.Invoke(new Action(() =>
    Is on one UI thread.
    Your window is created on another ui thread and this isn't going to work.
    You could possibly find that other thread but this isn't really a good plan.
    I have a piece of advice for you.
    DO NOT OPEN WINDOWS ON DIFFERENT THREADS !!!!!!!
    It's a bad idea.
    No matter what benefits you think this will deliver, it is a disaster waiting to happen for you.
    I led a team on a project where we did this.
    Had to back it out in the end.
    The solution to your issue is to open all windows on the same UI thread.
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • I group messaged from my ipad and this has screwed up the way my messages are reveived by my friends (it creates new threads in their phones with my email in place of my contact name) I've stopped messaging from my ipad but the problem remains. Any help?

    I have an iPhone 4S and use the group texting feature ALL THE TIME. I recently updated my iPad to the latest software and made the colossal mistake of continuing my group messaging from my iPad while connected to wifi. Doing this has successfully screwed but every group text thread I am in, to the point where its very hard for those involved in the thread to keep up. When I initially messaged those I was already engaged in text threads with it created a new thread in their phones replacing my name in their phones with my email. At first this was not a big deal but ever since then the people I am messaging have become increasingly frustrated with how my messages come through. If I am messaged in a group text and respond to it, sometimes when I respond it will create an entirely different thread in my recipients phones. So at that point they have to switch threads in order to read what I wrote. The new thread that my phone creates will send the message under my email not my name (related to the contact they have me saved as in their phones). The worst part about it is that there seems to be no rhyme or reason to why or when my phone will send the message as normal or under my email like it did with my iPad. I haven’t messaged from my iPad since these problems immediately began a month ago but the issues still continue. I have tried everything to get this to stop, I’ve turned off my wifi, I’ve had my friends delete the threads that my messages create in their phones. I’ve had them delete my email in their contact lists and nothing has worked. Can you help me? Any info you could provide would be greatly appreciated.
    Note: My phone message no different whatsoever. All the threads have remained the same. The issue is what it is doing to the people that I am messaging.
        Best Regards
             Rick Mulhern
    Message was edited by: Rickapplehelp19

    I have this identical problem.  For a while my group texts didnt show up on my ipad.  Then one day they did, maybe everyone in the group started using the same os version or something.  Ever since my first reply to the group there have been complaints of multiple threads.  I can not find a pattern for when my group text's decide they want to create a new thread. (it doesnt happen every time)  Everyone in the group has deleted the thread, we've all toggled imessage on/off etc.  There still hasn't been a solution.
    Any help would be appreciated.
    Thanks

  • Printing problem with new Intel iMac and Indesign CS3

    Hi there,
    this might not be the right place to ask for, but has anybody here experienced printing problems in Indesign CS3 with Tiger?
    I just installed the software and tried to print out of Indesign, but nothing. I can see on the panel that data is beeing received but no printing action. And this is just out of the new Indesing CS3.
    Any suggestions?
    Best
    Rolf

    Our office is printing fine from ID & PS CS3. This is from Intel & PPC Mac's running 10.4.9.
    What is your printer and how is it configured for printing, ie USB or IP.
    Also, have a look at the cups error log. You can find this via System Profiler > Software > Logs. This will show which process is failing for the spooled job. You can post it back here for more help.

  • HP LaserJet 1022 Printing Problems - Please Post Here

    Sorry, I hate to create a new thread, but tracking so many different threads on this one issue is becoming problematic for me. So with that being said, if you are still having a problem with printing to a LaserJet 1022 after the full uninstall I detailed in the FAQ thread followed by installing version 2.2 of the HP driver package, then let me know here. And specifically I want to know is which device you have, how your device is connected, the print driver version, and what apps are giving you problems. In my own personal testing, here is what I have found:
    USB direct connect - OK, I have yet to run into a problem here.
    USB connected to an Airport Extreme N - OK, I have yet to run into a problem here.
    USB connected to an Airport Express G - Paused problem. I got print job/page out and then the printer paused and would not resume. I don't have a functioning work around here yet, but I'm trying.
    So if I were going to fill out my own form, it would look like this:
    Printer: LaserJet 1022n
    Connection: USB connected to an Airport Express G (Firmware version 6.3)
    Driver Version: 1.1.0.182
    Apps: All
    Problem Description: Printer queue goes into a Paused mode and won't resume
    And to get you started, I have left a blank template at the end of this post.
    Also please make sure to include whether you have the 1022, 1022n, or 1022nw AND how it is connected to your Mac. If users of the 1020, what to chime in on this thread that is OK. Anyone else, please post in the FAQ thread or a different device specific thread. As the 1022 seems to be the most problematic at the moment, I'd like to track this down as quickly as possible.
    Just trying to help.
    Andrew
    =====
    Printer:
    Connection:
    Driver Version:
    Apps:
    Problem Description:

    Printer: LaserJet 1022
    Connection: USB connected to an Airport Express N (latest firmware, etc)
    Driver Version: 1.1.0.182
    Apps: All
    Problem Description: Can sometimes print a single page but then all status lights flash on printer and I have to turn the printer off - other times, nothing happens (printer pauses and will not resume). Have tried connecting via Bonjour and IP address but same problem occurs.

  • Continuing printing problems with LR 1.3.1 (magenta)

    Downloaded/installed the .1 version of 1.3 hoping that it would "fix" the magenta tinge associated with printing thru LR print. It did not. Still the same magenta tint. Although most of the discussion in previous threads had to do with MACs, I'm running a vista PC. This is a new PC ... previously had an XP PC running version 1.2 ... no issues. Do the issues identified for MACs also apply to PC users? Also not printing to an Epson printer, but to an HP B9180. Thanks.

    Sorry I'm a bit late to this thread. Erik and Samora, I am glad that you solved the Lightroom / HP B9180 printing problem. Please keep this forum posted about HP followups or any future printing problems you may have.
    Not to jinx you, but I have been down that road before. I started out with Lightroom printing with the magenta tint, mentioned by many others. I didn't understand what was happening since I had a managed workflow on my XP machine, and PS CS3 made excellent prints on the B9180. I spent much time on this forum looking for answers. Finally I thought I found the answer and changed the default printer to the B9180. (See http://www.adobeforums.com/webx/.3bca1a12/8 for the full info.) Unfortunately, the good news didn't last. Within a couple of months Lightoom returned to its former bad behavior.
    I think there is an insidious problem here with Lightroom, much more than people simply not selecting the correct profile or not understanding color management. What works for some people does not work for others. What worked at one time for me (see the above reference) now longer works. It seems that most people do not have a problem but others have great problems that apparently defy logic. The Lightroom bug bites Epsons, HPs, and Canons, as well as both Windows and Mac machines. After hours of analysis and testing, the best I can come up with is: "it just doesn't make sense." (I say this with tongue-in-cheek since I'm a highly-analytical person.)
    After a couple hours of test printing, all unsuccessfully, I tried to reduce possible conflicting issues by deleting from the B9180 color management properties all profiles, except the HP PSPro B9100-Advanced Photo Glossy; this is so Lightroom could not inadvertently select another profile. I made sure that the B9180 printing preferences was set to Application Managed Color. Then I made sure that the profile selected in the Lightroom Printing module was HP PSPro B9100-Advanced Photo Glossy. Still the magenta tint. I also get the tint using a custom profile from InkJetArt for one of their papers. I do not get the magenta tint when I send Lightroom output to my old Epson 1280, which I also have connected to the computer (parallel cable instead of USB). It just doesn't make sense.

  • Startup class : Context lookup for a Home fails in a new thread

    Hi All,
    I am having a funny problem with Weblogic Startup class.In the startup method,
    I am creating an instance of InitialContext. I called look up in this context
    for a bean's home. It works and it retuns the proper Home interface.
    But, when I use the same InitialContext instance in a new thread, and again if
    I call look up for the same bean's home, the server fails with a SecurityException.
    I don't have any Role based Security for this bean.
    Btw, I am using Weblogic 5.1 & SP7.
    Any ideas or help, appreciated..
    Thanks in Advance
    Srikanth Goli
    Here is the code.
    public String startup(String name, Hashtable args) throws Exception {
    InitialContext initialContext = null;
    try {
    initialContext = new InitialContext();
    UserPreferencesHome userPreferencesHome =
         (UserPreferencesHome)initialContext.lookup
         (UserPreferencesHome.DEFAULT_URL);
    //This prints Properly
    System.err.println("StartupTest: userPrefsHome is " + userPreferencesHome);
    } catch(Exception e) {
    e.printStackTrace();
    Thread th = new Thread(new TestThread(initialContext));
    th.start();
    return "ok";
    class TestThread implements Runnable {
    Context context;
    public TestThread(InitialContext ctx) {
    context = ctx;
    public void run() {
    try {
    //This is failing
    UserPreferencesHome userPreferencesHome1 =
         (UserPreferencesHome)context.lookup
         (UserPreferencesHome.DEFAULT_URL);
    System.err.println("UserPreferencesHome1 in the thread is " + userPreferencesHome1);
    } catch(Exception e) {
    e.printStackTrace();
    Here is the exception, I am getting
    java.lang.SecurityException: User "guest" does not have Permission "lookup" base
    d on ACL "weblogic.jndi.com.capgroup.btps".
    at weblogic.security.acl.Security.logAndThrow(Security.java:372)
    at weblogic.security.acl.Security.checkPermission(Security.java:254)
    at weblogic.jndi.internal.NamingSecurityManagerImpl.checkPermission(Nami
    ngSecurityManagerImpl.java:98)
    at weblogic.jndi.internal.NamingSecurityManagerImpl.checkLookup(NamingSe
    curityManagerImpl.java:45)
    at weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java:
    737)
    at weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:133)
    at weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:574)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at com.capgroup.btps.server.TestThread.run(StartupTest.java:49)
    at java.lang.Thread.run(Thread.java:484)

    Hi All,
    I am having a funny problem with Weblogic Startup class.In the startup method,
    I am creating an instance of InitialContext. I called look up in this context
    for a bean's home. It works and it retuns the proper Home interface.
    But, when I use the same InitialContext instance in a new thread, and again if
    I call look up for the same bean's home, the server fails with a SecurityException.
    I don't have any Role based Security for this bean.
    Btw, I am using Weblogic 5.1 & SP7.
    Any ideas or help, appreciated..
    Thanks in Advance
    Srikanth Goli
    Here is the code.
    public String startup(String name, Hashtable args) throws Exception {
    InitialContext initialContext = null;
    try {
    initialContext = new InitialContext();
    UserPreferencesHome userPreferencesHome =
         (UserPreferencesHome)initialContext.lookup
         (UserPreferencesHome.DEFAULT_URL);
    //This prints Properly
    System.err.println("StartupTest: userPrefsHome is " + userPreferencesHome);
    } catch(Exception e) {
    e.printStackTrace();
    Thread th = new Thread(new TestThread(initialContext));
    th.start();
    return "ok";
    class TestThread implements Runnable {
    Context context;
    public TestThread(InitialContext ctx) {
    context = ctx;
    public void run() {
    try {
    //This is failing
    UserPreferencesHome userPreferencesHome1 =
         (UserPreferencesHome)context.lookup
         (UserPreferencesHome.DEFAULT_URL);
    System.err.println("UserPreferencesHome1 in the thread is " + userPreferencesHome1);
    } catch(Exception e) {
    e.printStackTrace();
    Here is the exception, I am getting
    java.lang.SecurityException: User "guest" does not have Permission "lookup" base
    d on ACL "weblogic.jndi.com.capgroup.btps".
    at weblogic.security.acl.Security.logAndThrow(Security.java:372)
    at weblogic.security.acl.Security.checkPermission(Security.java:254)
    at weblogic.jndi.internal.NamingSecurityManagerImpl.checkPermission(Nami
    ngSecurityManagerImpl.java:98)
    at weblogic.jndi.internal.NamingSecurityManagerImpl.checkLookup(NamingSe
    curityManagerImpl.java:45)
    at weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java:
    737)
    at weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:133)
    at weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:574)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at com.capgroup.btps.server.TestThread.run(StartupTest.java:49)
    at java.lang.Thread.run(Thread.java:484)

  • Default printer problems with adobe 10.1.2

    I was having problems printing PDFs since upgrading to 10.1.2.  After reading and trying many recommendations, I happened to notice that my default printer(I have only one printer) was listed twice on the print window.  The first (default) printer is spelled "HP PSC 2350 series" (upper case 'PSC')  The second is "HP psc 2350 series" (lower case 'psc') .  The printer is named 'HP psc 2350 series' in my printers and devices, and if I select this printer, the page will print perfectly.  Now that I have solved my printing issue,  I would like to change the default setting on the adobe print window to come up as the active link, so I don't have to continue to select a different printer everytime I wish to print a document.  The printer by the lower case "psc" name is set as the default printer in printers and devices, and I cannot figure out why it doesn't come up as the default printer on the adobe reader print window.  I also cannot figure out how to change the default in the print window.   An added interesting fact is that I get no response in the print window when I try to select "preferences' or 'advanced' for the upper case 'PSC' printer.
    My computer runs in Windows 7 (64-bit).  The printer is HP psc 2355xi all-in-one.  Any suggestions are much appreciated

    I have not been able to select a different default printer for Adobe,  but I can print if I manually select the correct link everytime.
    Date: Tue, 6 Mar 2012 13:16:52 -0700
    From: [email protected]
    To: [email protected]
    Subject: default printer problems with adobe 10.1.2
        Re: default printer problems with adobe 10.1.2
        created by AMG13 in Adobe Reader - View the full discussion
    I am having the same issue.The correct printer is selected as the default printer on the control panel and there is no driver with the lowercase convention.However, the first printer option that appears is the lowercase convention. Is there any way to select a default printer for specifically for Adobe, as opossed to the PC itself?
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4248912#4248912
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4248912#4248912. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Reader by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Opening new frame in new thread

    I am having huge problems with an app. The main frame has a button on it. when the button is selected a second frame opens. I would like this frame to open in a new thread and the main thread to wait until it is closed again, but nothing I do seems to work! Does anyone have any ideas?
    I have the following code, but the problem is that it prints HAVE FINISHED before the Settings frame is closed:
    isRunning = true ;
    Thread settingsThread = new Thread()
         public void run()
              Settings sett = new Settings() ;
              isRunning = false ;
              System.out.println("stopped") ;
    settingsThread.start() ;
    while(isRunning)
    try
              System.out.println("sleeping") ;
              Thread.sleep(0) ;
         catch (InterruptedException ie)
              System.out.println("PROBLEM") ;
         } // end while
    System.out.println("HAVE FINISHED") ;

    Hi,
    it sounds like you are looking for a model dialog. If "Setting" inherits from JDialog you can use the constructor "JDialog(this, true)" in your frame of the main app. The problem in your code is, that event handling always has its own thread. You can't permit "running" the window in the background, but you can permit getting the focus with modal dialogs.
    bye
    Steffen

  • PSC 1210 draft printing problem - horizontal split

    Have had the 1210 some yrs now.
     Op System is Windows7.
    About a yr or so ago a problem cropped up every time printing in draft mode. Before that Windows7 and the 1210 were being used with a new computer for several months with no problems. 
    The printing program in Windows offers printing options of "fast draft","normal", and "maximum".
     In fast draft several lines on a print-out page are split horizontally across the entire line. I.e., the top half of the characters shifted left relative to the lower half. There does not seem to be any consistency wrt the number of OK lines between the split lines from document to document.
    In normal and maximum mode the printing is fine.
    Anyone have a solution or suggestion for this problem? Thank you for reading this.

    I couldn't help but notice this fast draft skewed printing seems to be narrowed down to Windows 7 drivers.   I am going to redirect this thread over to the most recent one and anyone who is still having this problem can go to the thread titled: Fast Draft Printing Problems.  I hope I can help although this seems like it is quite a few years old. Bear with me while I research this and if you are still interested in assistance you can select the Kudos star and I can track how many are still having this problem. 
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • Printing Problems after Reader 10 install

    Recently deployed Reader 10 to about 300 workstations using Group Policy.  Several machines are no longer able to print to some of the network printers.  These printers are HP printers using the Universal Print Driver.  When trying to print we get an error and the Adobe Reader application crashes.  It will however print to other network printers that are using an older device specific driver, printing to the same print device.  Have downloaded the latest HP driver, but it has not helped the situation.  The printing worked fine with Reader 8 and Reader 9.   Anyone with an Idea?

    Sorry only know Windows: Edit (menu)>Preferences>General>Application Startup>Enable Protected Mode at startup.
    Wayne Capra
    Date: Wed, 26 Oct 2011 10:37:59 -0600
    From: [email protected]
    To: [email protected]
    Subject: Printing Problems after Reader 10 install
        Re: Printing Problems after Reader 10 install
        created by Al1iOop in Adobe Reader - View the full discussion
    I am using a Mac 10.6 and cannot find the "Enable protected mode at startup" in General or any other options. Does anyone have an answer for Macs? Thanks.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/3991540#3991540
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/3991540#3991540. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Reader by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • J2ME problem with threads

    Hi all,
    I would like to ask you for a help. I need to write a small program at my university. I started to write a midlet which function would be to countdown time for sports activities. I woul like to start a new thread - the one that counts down - and at the same time make the main thread sleep. After the "countdown" thread finishes, the main thread wakes up and waits for user input. The problem is that when the "countdown" thread finishes his work, I've got Uncaught exception java/lang/NullPointerException. error and the midlet halts.
    Below you can find the code
    import java.lang.*;
    import java.util.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class intervals extends MIDlet implements CommandListener
    public Display ekran;
    private SweepCanvas sweeper;
    private Form rundy;
    private TextField round0, round1, round2, round3, round4, round5, round6, round7, round8;
    private long czas,x;
    private Command exitCommand;
    private Command addRound;
    private Command delRound;
    private Command start;
    private TextField repeat;
    private Form odliczanie;
    private Alert ostrz;
    Licznik thread;
    String test;
    StringItem test1;
    int parz,i,j,k;
    static int l;
    int ilrund;
    int ilpowt;
    Item sec;
    long sec1;
    public intervals()
        rundy = new Form("Interwa&#322;y sportowe");
        exitCommand = new Command("Wyj&#347;cie", Command.EXIT, 2);
        addRound = new Command("Dodaj","Dodaj rund&#281;", Command.ITEM,1);
        delRound = new Command("Usu&#324;","Usu&#324; ostatni&#261; rund&#281;", Command.ITEM,1);
        start = new Command("Start", Command.ITEM,1);
        odliczanie = new Form("Odliczanie");
        TextField dodaj(TextField kolej)
            kolej=new TextField("Podaj czas (s) rundy "+parz,null, 4, TextField.NUMERIC);//stworzenie nowej instancji do wybierania czasu trwania rundy
            if(rundy.size()==0)
                rundy.insert(rundy.size(),kolej);
                else
                    rundy.insert(rundy.size()-1, kolej);
            return kolej;
        void odliczanie(TextField round)
            monitor m=new monitor();
            k=Integer.parseInt(round.getString());
            ekran.setCurrent(odliczanie);
            thread=new Licznik(k,odliczanie);
            thread.start();
            ekran.setCurrent(rundy);
    public void startApp()// throws MIDletStateChangeException
        rundy.deleteAll();
        repeat = new TextField("Podaj ilo&#347;&#263; powtórze&#324;",null,1,TextField.NUMERIC);
        rundy.addCommand(addRound);
        rundy.addCommand(exitCommand);
        rundy.setCommandListener(this);
        Canvas obrazek = new MyCanvas();
        ekran = Display.getDisplay(this);
        ekran.setCurrent(obrazek);
        czas=System.currentTimeMillis();
        while (System.currentTimeMillis()<czas+1000)
            continue;
        ekran.setCurrent(rundy);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
        notifyDestroyed();
    public void commandAction(Command c, Displayable s)
        if (c == exitCommand)
            destroyApp(false);
            notifyDestroyed();
        else if(c==addRound)
            if(rundy.size()==0)//Sprawdzenie ilo&#347;ci elementów w celu poprawnego wy&#347;wietlania liczby rund w formie
                parz=1;
                else
                parz=rundy.size();
            switch(parz)
                case 1:
                    round0=dodaj(round0);break;
                case 2:
                    round1=dodaj(round1);break;
                case 3:
                   round2= dodaj(round2);break;
                case 4:
                    round3=dodaj(round3);break;
                case 5:
                    round4=dodaj(round4);break;
                default:
                    ostrz=new Alert("Uwaga","Maksymalna liczba rund wynosi 9", null, AlertType.INFO);
                    ostrz.setTimeout(3000);
                    ekran.setCurrent(ostrz);
            if(rundy.size()==1)
                rundy.append(repeat);
                rundy.addCommand(start);
            rundy.addCommand(delRound);
        else if(c==delRound)
            if(rundy.size()!=0)
                rundy.delete(rundy.size()-2);
                if (rundy.size()==1)
                    rundy.deleteAll();
                if(rundy.size()==0)
                    rundy.removeCommand(delRound);
                    rundy.removeCommand(start);
        else if(c==start)
            ilrund=rundy.size()-1;
            if(this.repeat.size()>0)
                ilpowt=Integer.parseInt(this.repeat.getString());
            ekran = Display.getDisplay(this);
            for (i=1; i<=ilpowt;i++)
                odliczanie= new Form("Odliczanie");
                 for (j=0;j<ilrund;j++)
                    switch(j)
                         case 0:
                             odliczanie(round0);
                             break;
                         case 1:
                             odliczanie(round1);
                             break;
                         case 2:
                             odliczanie(round2);
                             break;
                         case 3:
                             odliczanie(round3);
                             break;
                         case 4:
                             odliczanie(round4);
                             break;
                         case 5:
                             odliczanie(round5);
                             break;
                         case 6:
                             odliczanie(round6);
                             break;
                         case 7:
                             odliczanie(round7);
                             break;
                         case 8:
                             odliczanie(round8);
                             break;
    class Licznik extends Thread
        int czas1,k;
        Form forma;
        monitor m;
        public Licznik(int k,Form formap)
            czas1=k;
            forma=formap;
        public synchronized void run()
            while(czas1>0)
                forma.deleteAll();
                forma.append("Czas pozosta&#322;y (s): "+czas1);
                try{Thread.sleep(1000);} catch(InterruptedException e){e.printStackTrace();}
                czas1--;
            if(czas1<=0)
                m.put();
        }and monitor class
    public class monitor
    boolean busy=false;
    synchronized void get()
        if(!busy)
            try
                wait();
            }catch(InterruptedException e){e.printStackTrace();}
        notify();
    synchronized void put()
        if(busy)
            try
            wait();
            }catch(InterruptedException e){e.printStackTrace();}
        busy=true;
        notify();
    }Can anybody help me with this?

    Groovemaker,
    Your Licznik class has a member m of type monitor, which has not been instantiated (in other words is null) hence, when calling m.put() you get NullPointerException. Please also mind, that using Thread.sleep(1000) is not an accurate way of measuring time.
    If I may, please use recommended for Java class naming conventions - some of your names use lower case, while other don't which is confusing to the reader.
    Daniel

Maybe you are looking for