Flash Screen with JWindow

Hi All,
I want to make a Flash Screen when my program start, and shows some information before hiding it and display the main window. I read from the forum that I should use JWindow to achieve what I want.
However, Forte doesn't have a JWindow template, I search for the site and cannot find much about how to use JWindow. Can anyone here kindly help me?
I want some sample code, or some resource about how to use JWindow.
Thanks

better try the following code
import javax.swing.*;
import java.awt.Dimension;
import java.awt.BorderLayout;
public class SplashScreen implements Runnable {
   JWindow          splashScreen;
   JProgressBar    progressBar;
   Thread              thread;
   /// assuming that following declarations are dummy apps associated with this class
   App1 app1;
   App2 app2;
   App3 app3;
   App4 app4;
   App5 app5;
   App6 app6;
   App7 app7;
   App8 app8;
   public SplashScreen() {
      splashScreen = createSplashScreen(350, 290, new ImageIcon(yourImageFilePath));
      splashScreen.setVisible(true);
      start();
   public void start() {
      thread = new Thread(this);
      thread.setName("ProgressThread");
      thread.start();
   // stop the thread
   public void stop() {
      if(thread != null) {
         thread.interrupt();
         thread = null;
   // close the progress of loading
   public void close() {
      stop();
      splashScreen.setVisible(false);
      // give a 2 sec. break
      try { Thread.sleep(2000); } catch(Exception ex) {}
      //////  Your Application Frame
      app.frame.setVisible(true);
   public void run() {
      progressBar.setString("Loading, please wait...");
      try{ thread.sleep(1000); } catch(Exception e) {}
      progressBar.setString("Loading App1 ");
      progressBar.setValue(progressBar.getValue() + 10);
      app1 = new App1();
      progressBar.setString("Loading App2 ");
      progressBar.setValue(progressBar.getValue() + 10);
      app2 = new App2();
      progressBar.setString("Loading App3 ");
      progressBar.setValue(progressBar.getValue() + 10);
      app3 = new App3();
      progressBar.setString("Loading App4 ");
      progressBar.setValue(progressBar.getValue() + 10);
      app4 = new App4();
      progressBar.setString("Loading App5 ");
      progressBar.setValue(progressBar.getValue() + 10);
      app5 = new App5();
      progressBar.setString("Loading App6 ");
      progressBar.setValue(progressBar.getValue() + 10);
      app6 = new App6();
      progressBar.setString("Loading App7 ");
      progressBar.setValue(progressBar.getValue() + 10);
      app7 = new App7();
      progressBar.setString("Loading App8 ");
      progressBar.setValue(progressBar.getValue() + 10);
      app8 = new App8();
      progressBar.setString("Loading Complete ");
      progressBar.setValue(progressBar.getValue() + 10);
      try{ thread.sleep(1000); } catch(Exception e) {}
      progressBar.setString("Starting App ");
      progressBar.setValue(progressBar.getValue() + 10);
      try{ thread.sleep(2000); } catch(Exception e) {}
      close();
   public JWindow createSplashScreen(int width, int height, ImageIcon splashIcon) {
      JWindow splashScreen = new JWindow();
      splashScreen.getContentPane().add( new JLabel( splashIcon ),
                                          BorderLayout.CENTER   );
      splashScreen.getContentPane().add( progressBar = new JProgressBar(),
                                          BorderLayout.SOUTH );
      progressBar.setValue(0);
      progressBar.setStringPainted(true);
      Dimension screenSize = splashScreen.getToolkit().getScreenSize();
      splashScreen.setSize(width, height);
      // center the window
      splashScreen.setLocation(  screenSize.width   /  2  -  width   /  2,
                                 screenSize.height  /  2  -  height  /  2  );
      splashScreen.setVisible(false); 
      return splashScreen;
   public static void main(String args[]) {
      new SplashScreen();
}

Similar Messages

  • Flashing Screen - with new installation

    I recently bought a new 60gb video ipod. My roommate had been using my computer, Windows XP, for his ipod, but is no longer needs to use my computer. I uninstalled his itunes and quicktime software from my computer so I could start clean with my new ipod. I install the software that came with my new ipod with a complete installation I plugged in my ipod. Itunes appears to detect my ipod but I have been watching “Do not disconnect” flash on my ipod screen for an hour. I have tried resetting both my ipod and computer multiple times, and have reinstalled the itunes software a few times as well. I tried updating the itunes software, but all my effort still leads me to the same flashing screen once itunes in operating. I can successfully eject my software using the itunes shortcut, but once the ipod is plugged back in I get the same flashing screen. Any help would be greatly appreciated. Thanks.

    I have the same problem: flashing screen, however with one variation, Itunes does not detect the iPod. So I cannot change from manual to automatic because the Itunes says "no iPod detected". I have tried reinstalling the software, resetting the iPod, and the iPod updater will not see the iPod as well, so I cannot update the software on the iPod. This seems to be an extremely arcane system! Can anyone help me please? Windows seems to grab hold of the USB connection and mount it immediately as a hard drive interdicting the iPod software. Windows explorer sees the Ipod hard drive and I can even transfer files to it, but the ipod software does not see the files! So I'm in the woods on this one. Can anyone help me on this, please?

  • My IMac is intermittently pulsing a flashing screen with noise - any solutions please?

    Please assist with a sudden onset problem with iMac Intermittent flashing pulsing noise.

    Might be a problem with the graphics card. Take your Mac to an Apple Store or Apple certified repair provider.
    Apple - Find Locations

  • MSI Z87-G45 external test build - no flash screen with 2 G.Skill Ram sticks

    Hi guys this is my first build and I'm encountering this issue on my test build.
    I'm using MSI Z87-G45 MoBo, G.Skill Ripjaws Series 8GB (2 x 4GB) DDR3-1600 Memory, i5 4670k
    RAM is only working one at a time. Both sticks work. They do not work alone in DIMM 3 or DIMM 4.
    Any advice on what to do? could it be speeds/timing of the ram? this is my first build so any help is greatly appreciated!
    I see that G.Skill sticky post, but since this is a test build outside of the case I don't have a keyboard attached or really any knowledge of how to alter the BIOS.

    Quote from: mvam on 13-May-14, 07:02:12
    new ram - Corsair Vengeance... no luck. 
    any other ideas?
    time for a new mobo? it has to be the mobo right? cpu?
    One or the other. CPU can be ruled out if you know someone who can test it for you on another known working board. That leaves the mainboard as faulty. You could try a PSU power cord removed, battery removed for a short time, clear CMOS and try again with a RAM stick in DIMM2.

  • Problems with JWindow

    Hello! I was trying to make a splash screen with JWindow class. But nothing but a blank JWindow is shown after the program is run. I've already searched the forum for solution to this kind of problem and I found that few had similar problems. According to one solution, I called the pack() method before calling the setVisible() method with true. But it did not work for me. I use JDK 1.5.0_03. Please help me in this regard. Thanks.
    Here's my code:
    public class Test extends JFrame
         Test()
              JWindow splashScreen=new JWindow(this);
              splashScreen.setBounds(400, 400, 300, 253);
              Container splashCont=splashScreen.getContentPane();
              splashCont.setLayout(new GridLayout(1, 1));
              splashCont.add(new JLabel("This is a test!"));
              //splashScreen.pack();
              splashScreen.setVisible(true);
              try
                   Thread.sleep(5000);
              catch(InterruptedException e)
                   JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
              splashScreen.setVisible(false);
              setVisible(true);     //showing the JFrame
         public static void main(String args[])
              new Test();
    }

    >>
    http://forum.java.sun.com/thread.jspa?forumID=256&thre
    adID=476900@bsampieri - the thread mentions a focus problem...
    have you tried using a modal JDialog and using
    setUndecorated(true) on it instead of a JWindow?
    This would also prevent you from having to setup the
    e glasspane.Yeah... maybe. But when I wrote that, I think it was before that was an option.

  • Screen Flashing while Dragging JWindows

    I know this question has been asked here in different forms but ...
    I have a top level JWindow. I implemented the mouse motion handlers to implement dragging the window around, but when the window is dragged you get screen flashing and the JWindow repaints in a fashion similar to mouse trails. If you've tried this you know what it looks like.
    I have seen the solution to this a long time ago but I didn't save the code, so I know there is a way to get the painting to work properly. Seems like it involved paintImmediately() or invokeLater() or something like that.
    If you've tried to implement "transparent top levels" in Java (not possible btw) you know what a pain it is to get this to work. I have requested this feature from Sun Java Team and they said they were looking at it.
    I know about the 1.4 JFrame.setUndecorated() but that won't work for me.
    Thanks.
    K.

    Hello @rpowell55317,
    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the HP Forums I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More.
    I understand that you are having issues with your HP TouchSmart 520 while playing games. I would be happy to assist you, but first I would encourage you to post your product number for your computer as there are various versions of the 520. I am linking an HP Support document below that will show you how to find your product number. As well, if you could indicate which operating system you are using. And whether your operating system is 32-bit or 64-bit as with this and the product number I can provide you with accurate information.
    How Do I Find My Model Number or Product Number?
    Which Windows operating system am I running?
    Is the Windows Version on My Computer 32-bit or 64-bit?
    Please re-post with the requested information and I would be happy to provide you with assistance. Thank you for posting on the HP Forums. Have a great day!
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    Dunidar
    I work on behalf of HP
    Find out a bit more about me by checking out my profile!
    "Customers don’t expect you to be perfect. They do expect you to fix things when they go wrong." ~ Donald Porter

  • I have a PowerMac G4 running ProTools that no longer boots up.  All I get is a file folder on the screen with a flashing question mark in it.  Ran the Utility disk and all systems passed.  Any ideas?

    I have a PowerMac G4 running ProTools that no longer boots up.  All I get is a file folder on the screen with a flashing question mark in it.  Ran the Utility disk and all systems passed.  Any ideas?

    You need to use the computer's install disks to repair the hard drive or install a new OS.
    (58033)

  • Grey Screen with Flashing Folder with Question Mark

    Hi,
    I need some help with an issue I'm having on my Mid-2012 Macbook Pro (13"; OSX 10.9.2; 8GB RAM).  I've had issues with this Macbook for the past year.  I've worked with Apple Support and had it into the Mac Store prior to the warranty expiring (Dec 2013).  I have the exact same model with all of the same specs that my employer purchased at the same time for work as my work computer, and I haven't had any issues with that one.
    Previously, the system would slow down excessively and eventually start hanging. Occasionally the screen would start flashing.  Apple phone support had me wipe the hard drive and re-install the OS and all of my file, apps, and setting from my Time Machine backup.  That worked for about four months, and then it started again. Since it was getting close to the warranty expiration, I took it to an Apple Store. They ran a bunch of diagnostics, said the hardware was all fine but the OS needed to be re-installed.  They did that in early Dec, and everything was cool again until about three days ago.  Three days ago, it started slowing down and freezing again (even when doing non-memory intensive tasks such as broswing the web with only a couple of tabs open and no other applications open).  Last night, it froze hard and wouldn't shut down, so I had to cold boot it.  When I tried to power it back on, it came to the grey screen with the flashing folder with the question mark (which I know means it can't find the boot sector).  I waited until this morning, and it stil wouldn't boot. I then rebooted into Startup Manager, and the HDD was there. I selected the HDD, and it booted fine and ran fine for a couple of hours (I was able to do a Time Machine backup).  Then it froze up solid again. I waited for an hour or so before cold booting (don't like doing that), and when I tried rebooting, I got the flashing folder with the question mark. I tried booting into the Startup Manager again, but this time, my HDD wasn't listed. I then booted into the OSX Recovery utility (CMD R on boot), went into the Disk Utility hoping to do a disk repair, but my HDD wasn't listed. I have an external SATA to USB adapter, so I pulled the HDD, hooked it to a USB port on my other (identical except it doesn't have problems) Macbook Pro.  Once my other Macbook booted, the HDD from the bad Macbook Pro showed up fine.  I ran a verify and repair disk on the HDD from the bad Macbook, and it didn't show any issues.
    So I figured I'd be really brave. I took the HDD from the bad Macbook Pro and put it in my work (good) Macbook Pro (I took the HDD out of my working work Macbook Pro).  It booted fine.  I then did the verify and repair disk (again no errors) and verify and repair permissions (it found a few, but no more than it has in the past). I ran it that way for about an hour with no issues. That led me to believe that the HDD for my personal Macbook was fine, and it must be an issue with the SATA cable or the mainboard. 
    Here's where it gets odd.  I put the HDD from my work Macbook Pro into the bad Macbook Pro thinking it wouldn't even recognize it.  It did recognize it, and it booted fine.  I ran it like that for about 30 minutes.  It did have a couple of short freeze ups, but it didn't lock up solid. I didn't want to push my luck and possibly damage the HDD for my work Macbook, so I shut down the bad Macbook Pro ended the experiment at that point.
    I put the original HDD back in the Macbooks where they originally came from. I then ran the Apple Hardware Test (press and hold D on startup) on the bad Macbook Pro; I did the extended testing option. It ran for about an hour, but it didn't find any issues with the bad Macbook Pro. 
    I put the HDD from the bad Macbook back in my working Macbook and wiped the disk and reinstalled OSX from a Time Machine Backup from last week (before the problems occured).  Put it back in the bad Macbook and still no luck. Finally I tried resetting the PRAM because I saw that as one of the options on this discussion board. 
    I've searched and read everything I can find related to this, but I can't find anything that works, and I'm at my wits end.  Can anyone point me in a direction of what might be wrong and what else to try?
    Thanks!
    Mike

    You performed thorough and methodical troubleshooting, and this appears to be the most important result:
    I put the HDD from my work Macbook Pro into the bad Macbook Pro thinking it wouldn't even recognize it.  It did recognize it, and it booted fine.  I ran it like that for about 30 minutes.  It did have a couple of short freeze ups, but it didn't lock up solid.
    Given compatible hardware, you ought to be able to swap hard disk drives in exactly that manner, so it shouldn't surprise you that it worked. However, installing the "known good" HDD in the problem machine should not have resulted in any freeze-ups at all.
    You can conclude the hard disks (both of them) are serviceable and whatever fault exists probably lies elsewhere. Often the SATA cable is damaged or not seated properly, and is likely to fail more than anything on the logic board. Inspect the logic board's SATA connections and make sure there are no contaminants or damage. The two drives and two logic boards are going to have slightly different component tolerances, so perhaps the defective one is simply exceeding some limit.
    Apple Hardware Test is very cursory and essentially tests for the presence of operable hardware. It is far from an exhaustive test, and only a report of a failure can be relied upon for accuracy. For a more thorough test you would need to have Apple evaluate it using the time-consuming Apple Service Diagnostics. Even then, they may come up without a clue, and eventually someone will suggest a logic board replacement which can be expensive.
    It is an unusual problem, and I don't know how much time Apple would invest in diagnosing it before they conclude you really ought to buy a new Mac instead. They might surprise you though in that a "depot repair", if yours is eligible, is a very cost effective option so consider it.
    Given your ability you might also consider purchasing a replacement logic board from PowerbookMedic, or even sending it to them for a flat rate repair.

  • HELP: Bootcamp wont start up anymore.. ( Black screen with flashing cursor)

    Today i tried to boot up my Windows VISTA partition with bootcamp and I always end up with a black screen with a flashing cursor. I already tried several times but still no luck..
    Strange thing is I can still boot up my Windows Vista partition in Parallels on Mac... But after u reboot and try this with bootcamp again the black screen with the flashing cursor.
    I search on the internet for a fixes or solution but no luck, and i don't want to reinstall every thing on my windows partition again..
    also tried the cmdalt+PR thing on startup without any luck and i have no clue what this problem is causing.. i only remember installing the last updates for my mac with the new App store feature but don't know if that could cased any problems.. it looks like a firmware problem or something to be honest i really don't know..
    Can someone help me? or figure this out? any fix for this?
    thx
    Message was edited by: Mattieshark

    Ever Google (or Bing)?
    http://windowsteamblog.com/windows/archive/b/windowsvista/archive/2006/12/05/win dows-recovery-environment.aspx
    http://www.informationweek.com/news/windows/showArticle.jhtml;?articleID=2000003 29
    http://www.bing.com/search?q=Vista+recovery
    In brief, did you ever think to boot from Vista DVD?
    And you might want to look into programs to backup / clone / and provide system restore capability.

  • My MacBook Pro just turned itself off while installing Windows 7. It has now got a black screen with a white flashing bar in the top left corner...what can I do?

    I was just installing windows 7 onto my MacBook Pro. I selected to have 200GB for Windows and the rest leave for Mac.
    I clicked install and the bar filled up as it should do. However, once the install had completed, my MacBook turned itself off. I assumed this was normal. Now, my MacBook has a black screen with a white flashing underscore in the top left corner.
    What is wrong and what should I do?

    Hold down the Option key when starting up then on the sceen that comes up select Mac OS X to boot from.
    The Win 7 install didn't go well and is hung in some way. You should use boot camp assistant to remove the win partition and start over.
    Make sure you are using a Retail version of Win 7. A Branded OEM version, like ones from Dell and HP, will NOT work to install Windows 7 on your Mac.

  • My 16 GB iPhone 5 is stuck on a black screen. A white screen with the apple logo flashes occasionally. iTunes won't recognize the phone, and hard reboot failed. Can anyone help?

    I just bought a gently used 16 GB iPhone 5. I set the phone up earlier today with no issues at all, installing backup data from my iPhone 4, syncing the new phone to my iCould, setting up my new SIM card, etc.
    The phone was working fine (I was able to send and receive texts, use WiFi, manage apps, etc.) for the first hour or so. Then, without warning, it shut down. The screen is solid black, but every now and then it flashes white with the black apple logo.
    I tried multiple hard reboots — all failed.
    iTunes (on my MacBook Air, running Yosemite) is now unable to recognize the device, although it recognized it without issue earlier today.
    I live overseas, so going to an Apple store is a bit inconvenient. If I can trouble shoot this at home (and in English), it would be really helpful.
    Thank you in advance if you have any helpful tips or suggestions!
    Best,
    MilliGFunk

    Gregseymour-
    DO NOT STICK A PAPER CLIP IN THE HOLE!
    There are two holes.  One is a small one that has a microphone behind it.  A paper clip would probably ruin the microphone.  The other is a 1/8 inch hole where you plug in a headset.  A paper clip might short-circuit something.
    First connect the iPad to its wall charger for at least half an hour to be sure it has enough juice to get started.
    Then if the iPad does not wake up when either the Home or Sleep button is pressed, press and hold the Sleep button for several seconds and see if the Apple logo appears.  If it does, then your iPad has been turned off instead of merely being put to sleep.
    Beyond that, look for an iPad repair center.  The Apple Authorized Repair Centers may be more expensive.  If you want to try them, look at <Apple Authorized Repair Centers>.  There may be one in your city.
    Fred

  • Tecra M2 - black screen with the cursor flashing

    Hi guys,
    Im hoping someone out there may be able to help me fix my laptop.
    Ive read a couple of posts but not sure they can help me.
    When I swicth on my Tecra M2, I just end up with a black screen with the cursor flashing in the top left or I get a screen filled with alternating 0's and 1's.
    Sometimes the TOSHIBA splash screen appears with the boot options, other times it doesnt.
    I cannot boot to CD and it wont boot to the HDD. Ive taken the HDD out and the CDROM out but it does the same thing which to me suggests that its not getting through the BIOS even as far as the boot sequence.
    Does this sound like BIOS failure to you and do you know of a way to fix it? Ive tried taking the battery out, powering off and starting again but the same thing happens.
    Any advice would be be appreicated.
    Thanks,
    Ross

    I have had this twice now and in both cases it was caused by a faulty HDD - to confirm that the motherboard etc is still OK load the recovery CD in the DVD drive (or even better a freestanding XP disc), press F2 on startup and shift the cursor under the DVD drive as the boot drive.
    If the motherboard etc is OK you will get the reload instructions (from the recovery disc) or a Windows install screens (from the XP install disc).
    Satisfied that the machine at least works - replace the HDD and recover from the recovery disc or try a Windows repair from the recovery console (from the XP install disc with the HDD still in place).
    In my cases I was forced to recover to a new HDD and then rebuild the machine from backups - I now clone the HDD when rebuilt.

  • My C5280 All in one printer flashes a blue screen with error B0248122.

    It flashes a blue screen with a different B 8 digit number each time. All the buttons on the front flash yellow. I have to unplug it to turn it off.  Occasionally it will say to turn it off and turn it back on, but it rarely solves the problem.  This used to be an infrequent problem, only appering occasionally, now it is all the time and am not able to use my printer at all.
    Any ideas?

    Hello,
    This error typically is caused by some issue with the ink delivery system.
    Recommend to follow some steps mentioned in this link:
    http://h10025.www1.hp.com/ewfrf/wc/document?docnam​e=c00489814&lc=en&cc=us&dlc=en&product=4083871#N51 
    Hope this helps.
    I work for HP.

  • Black screen with white flashing line on startup

    ~computer info~
    Mac OS X Version 10.6.7
    2.66 GHz Intel Core 2 Duo
    4GB 1067 MHz DDR3
    24 in. Montior
    Startup disk: Macintosh HD
    ~Partition info~
    FAT32 Windows XP
    ~issue~
    Hello; I've recently encountered a problem with bootcamp that I can't find a solution to... Every time I start up the computer in boot camp, all I get is that black screen with the white flashing line. It comes up, goes to a plain black screen, then quickly comes up again. It never stops, either. I've let it run, and it won't finish.
    I've had the partition for MONTHS now, and nothing like this has happened. I've had it since I upgraded to Snow Leopard awhile back, and needed to re-partition the drive. I literally had been using it the day before it happened, and the only thing that happened was that I got that "Windows Security 2011" malware, but I got rid of it fully (As I've gotten it 3 times this month). The other two times I got it, it didn't do anything. I fixed it, and went on with life. But is it possible that it broke something in the partitions inner files this time?
    I ran disk utility, and it said the partition was broken. After verifying it and confirming this, I did "Repair Drive", as it allowed me to. It finished with no errors and said it completed, so I tried to go back into the partition, but it gave me the same results.
    To be honest, most of my stuff is on my External Harddrive, so re-doing the partition is only going to be time used to me. But I still DO have things on there, and it'd be a pain to transfer them back and forth between the Mac and Windows partitions... I'd really like to know if there's anyway to fix this, or if it's just going to fall back to me re-partitioning the drive...
    Thanks for the help in advance.

    That blinking line is a "cursor."  It's only supposed to show for a second or two as your iMac switches to and then starts Windows.  But as you indicate here, it's not getting past the cursor..
    Disk Utility can repair FAT volumes, but it cannot correct issues caused by corrupted items which, if the volume was repaired, there may be some.
    Since we are dealing with a Windows boot partition, it's entirely possible that the repairs inadvertently corrupted the data Windows needs to start and run.  It's also posible that Mac OS, in fixing the Boot Camp volume, overwrote the existing boot record in the Windows partition with a generic, though non-bootable version.
    Windows' own CHKDSK should have been used to make the repairs rather than the OS X Disk Utility, which would have avoided this worst-case scenario in data recovery.  CHKDSK has a special version of itself on the Windows disc, which may be accesed by using the Windiws Recovery Consile upon pressing R during the "Welcome to Setup" screen.
    Though it appears ftom my position here that you will need to reinstall XP, it may yet be possible to recover data that hasn't been copied to the external HDD.  For this task, I'd like to recommend that you start up in Mac OS for the time being, and pull any new or changed items from the Boot Camp volume except for installed software; the latter are nearly impossible to transport with reasonable accuracy, and should instead be reinstalled.
    Once you have what you need, format your Boot Camp volume and reinstall Windows, this time selecting NTFS as your filesystem.  NTFS is the preferred option for Windows in general, thiaks to its innate file access controls as well as the ability to compress or encrypt data "on the fly."  NTFS can be read by Mac OS X, but not written from it, thus NTFS volumes cannot be altered except by Windows itself..  But it is also a requirement if you plan to upgrade your unit using Windows 7 in future.
    Nate

  • I get a white screen with a grey flashing folder icon with a question mark in it when i try to start up my i mac, what's happening?

    A few days ago my i mac when into grey screen; there were a few options for starting up, restoring etc i tried all of them to the extent possible but didn't work. Then i decided to unplug my external backup drive in case it may be erased or info lost in this process and now all i get when i turn it on is a white screen with a flashing folder and question mark. Any ideas?

    That indicates the computer is having difficulty finding the startup volume. Your internal HD may have failed or the system may have "forgotten" where it is. If you are using Lion or later (10.7.x or later) then restart in the Recovery Partition and choose the startup disk.  Before doing anything carefully read and follow Apple's instructions in:
    A flashing question mark or globe appears when you start your Mac

Maybe you are looking for