Urgent, y does panel make my game disapear??

Hi i have created a game whereby users click on the screen where a triangle apears corresponding to the location of the click. I have now added the panel functionality. When i display my game all i see is the
Label titleLabel = new Label("THE TRIANGLE GAME!!!!!");
          Label textColourLabel = new Label("Select the colour you want your shapes to be");Which is displayed on the north, i.e the top.
MainWindow() code
MainWindow()
          setTitle("Drawing Triangles");
          m_bMouse = false;
          m_nTrianglesToDraw = 0;
          m_nTrianglesDrawn = 0;
          m_WndFont = new Font ("Helvetica", Font.BOLD, 20);
          m_polyTriangleArr = new Polygon[9];
          n = 3;
          setBackground(Color.yellow);
          Toolkit thisScreen = Toolkit.getDefaultToolkit();
          Dimension thisScreenSize = thisScreen.getScreenSize();
          m_nWndWidth = 2 * thisScreenSize.width / 3;
          m_nWndHeight = 2 * thisScreenSize.height / 3;
          setSize(m_nWndWidth, m_nWndHeight);
          Label titleLabel = new Label("THE TRIANGLE GAME!!!!!");
          Label textColourLabel = new Label("Select the colour you want your shapes to be");
          m_colour = new CheckboxGroup();
          m_red = new Checkbox("Red", m_colour, true);
          m_red.addItemListener(this);
          m_blue = new Checkbox("Blue", m_colour, false);
          m_blue.addItemListener(this);
          m_pink = new Checkbox("Pink", m_colour, false);
          m_pink.addItemListener(this);
          // Adding the panels
          Panel pTitle = new Panel();
          pTitle.add(titleLabel);
          Panel pButtons = new Panel();
          pButtons.add(m_red);
          pButtons.add(m_blue);
          pButtons.add(m_pink);
          Panel pRadioButtons = new Panel();
          pRadioButtons.add(textColourLabel);
          pRadioButtons.add(pButtons);
          // Create "Display Panel" for Radio Button to be placed in a panel with FlowLayout
          Panel pDisplayRadioButtons = new Panel();
          pDisplayRadioButtons.add(pRadioButtons);
          // Place pannel in appropriate area in a BorderLayout
          setLayout(new BorderLayout() );
          add(pTitle, BorderLayout.NORTH);
          add(pDisplayRadioButtons, BorderLayout.SOUTH);
          addKeyListener(new KeyCatcher() );
          addMouseListener(new MouseCatcher() );
          addWindowListener(new WindowCatcher() );
          setVisible(true);
     }Ideally, i would like to see the game with the available radio buttons at the bottoms, (south). Can som1 tell me why i am not able to see my game and how to resolve this.

Sorry guys i have solved the problem.

Similar Messages

  • Does ram make game play smoother?

    Hey, as many other people i am a minecraft lover, but currently on my 2010 white unibody macbook minecraft doesnt run very smoothly. I usually have to put the render distance on tiny because anything above short it makes the game play very laggy!
    I was wondering would increasing the ram to 4Gb or even 8Gb instead of 2Gb make me ably to run minecraft on a far render distance?
    Also it would be nice to know the performance of your computer/laptop compare to its specs.
    Thanks,

    Hey, as many other people i am a minecraft lover, but currently on my 2010 white unibody macbook minecraft doesnt run very smoothly. I usually have to put the render distance on tiny because anything above short it makes the game play very laggy!
    I was wondering would increasing the ram to 4Gb or even 8Gb instead of 2Gb make me ably to run minecraft on a far render distance?
    Also it would be nice to know the performance of your computer/laptop compare to its specs.
    Thanks,

  • Sorry does not make up for this purchase!

    Since corporate wouldn't give me an email to send this to, I'm posting this here.  
    Original-Recipient:{removed per forum guidelines}
    Final-Recipient: {removed per forum guidelines}
    Action: delayed
    Status: 4.4.7
    Will-Retry-Until: Sat, 10 Jan 2015 21:20:31 -0600
    X-Display-Name: .info
    ---------- Forwarded message ----------
    From: 
    To: <[email protected]>
    Cc: 
    Date: Thu, 8 Jan 2015 22:20:28 -0500
    Subject: Fwd: Elite and Irate Customer
    ---------- Forwarded message ----------
    From:
    Date: Mon, Jan 5, 2015 at 2:02 PM
    Subject: Elite and Irate Customer
    To: [email protected]
    Hello,
    I'm a customer that wanted to bring to your attention the lack of customer service I've received from the Best Buy store at your Tri-County location, here in Ohio.  On the 14th of November, I walked in the store to buy an open box electric stove that was advertised on your website.  Your website clearly stated that one was in stock at the Tri-County location.  I called the store and spoke to a representative prior to my arrival at the store to confirm that this information was accurate and the rep simply told me yes it was, if it says it one the website then to go off of that.  
    So I went to the store to purchase the stove and was unable to find it.  I had several associates help me look for it and nobody could find it and the managers determined that it wasn't in stock.  Since it was a Best Buy mistake, the manager offered to give me the new version of the stove for the same price, which saved me a little money.  As I'm patiently waiting for the final word from one of the managers, I start looking around for other things I may possibly want to buy and I come across an open box french door refrigerator, so I decide to purchase that as well.  Nothing was wrong with it, except for a couple scratches.   Keep in mind that this is nearly a couple weeks before thanksgiving, where I had nearly 30 attendants.  I just bought a dishwasher and microwave from lowes and wanted to have my complete appliance set on display just in time for Thanksgiving.
    When the items arrived at my home, a couple days before Thanksgiving, I was relieved that I received them on time.  For the most part, the delivery crew was acceptable, except for the fact that they broke a light switch on the wall as they were trying to move the refrigerator in it's place.  They told me about it and I told them that that was okay and that I was just happy that I received my appliances.  As anyone else would do, I waited for the fridge to get cold before I put the food back in and when it came time to do so, I noticed that the middle flap between both french doors was broke.  It's a bit deceiving because if you just look at it you can't really tell, but after opening and closing it a couple times, you could easily tell that it was broken.  So I called Best Buy that same day and told them of the problem.  I asked them if they had that part at the store, so I could just come in and get the replacement.  Note, that on the appliance defect report this was not listed, so I'm assuming it was damaged during delivery or was overlooked.  I mentioned this to the manager.  He said, that the item had to be special ordered, so as disappointed as I was that my fridge would not be fully operational for thanksgiving, I said it was okay and he told me that he would call me once it came in.  To give you a better idea of what my family is experiencing, we don't use the left door on the fridge.  
    2 weeks go by and I still haven't received a call, so I decide to call and check in for an update.  An associate tells me that the item just came in yesterday and that he would call me back in a few minutes to schedule a repair.  I don't receive a call that day, so I call best buy back a few days later.  Again, I speak to the same associate and he tells me that the item never came in and that the manager was just going to give me a new fridge instead. So I call your corporate office and speak with an associate and he says that he will get to the bottom of it and help me set up the delivery.  
    Well on the day of the delivery, which was a Saturday, I was told that it would be dropped off sometime between 3 and 5 in the evening, or something in that timeframe.  What do I do?  I empty out my fridge and clear a path for the delivery personnel.  It being a Saturday, I had plans and I haven't received a call from anybody.  So around half past 5, I start putting the items back in the fridge, as well as move the furniture back in place.  Keep in mind, this is no easy task.  I have a 4 bedroom home and a family of 5, so yes, I have a lot of furniture and a fully stocked fridge.  This probably took at least 2 hours to get everything cleared and to put it back in place when I found out they were not showing up.  
    I then get a call at 15 till 6 from the delivery crew telling me that they were on there way. Surprised and irate that they are now calling me, I have to refuse the delivery because we we didn't have time to wait around since we already had plans for the night.  I get another call from a Best Buy associate trying to reschedule and I told them that I've had enough of their dealings and that I would let corporate handle it and through corporate I would see that a proper delivery would then be scheduled.
    Well this morning I saw on my phone that I have several missed calls, as early as 6 in the morning from Best Buy delivery stating that I am suppose to recieve my fridge in the morning and I was there 2nd stop.  I call the guy and tell him that I was unaware of the delivery and that I would give you guys a call today to schedule the appointment.  I intend to call you after I send this email regarding that.  
    So in all, I've probably been on the phone with Best Buy personnel at least 10 times and several hours.  I spoke to several associates, including 3 different managers, 3 different delivery crews, and a rep from your corporate office once.  I think it's safe to say that this has been a total nightmare and saving a couple hundred dollars does not make up for it.  I wanted to reach out to you because as an educated consumer, who also happens to be an elite Best Buy member, I can firmly say that because of this "Nightmare" I will not be buying any more appliances from your store and you would be lucky if I bought anything else from the store.  You do have some pretty good deals on games and movies though, so I may continue to do that.  
    Please take this information and utilize it accordingly, obviously, this is not how business should be ran and I know this isn't the first time something like this has happened.  The exact same thing happend to my friend a few years back from a different store.  
    V/R,
    Member ID: {removed per forum guidelines}

    Hello penningtonj, 
    While it's great to hear that you seem to have received new inbox units at open box prices due to your experiences, it certainly sounds like the delivery portion of the experience could have been vastly better for you. 
    I'm glad to hear that the oven is working well for you, and I'm truly sorry to hear of the difficulties you've experienced with the open box refrigerator. Our open box items should be thoroughly inspected and marked accordingly for its condition or any missing parts or accessories. It is disheartening to hear that a damaged part may have gone unnoticed. With that said, it's awesome that the store has offered to replace it. 
    We strive to ensure our deliveries are seamless and hassle-free. Given you have a sizable family, I know emptying a refrigerator is no easy task, as I grew up in family of a similar size, and should the refrigerator have to be emptied for any reason, it was a bit chaotic! It is regrettable to hear that the delivery team was late, and that they failed to contact you sooner to let you know of their delay. Furthermore, it is strange that you may not have been aware of (and thus completely unprepared for) the rescheduled delivery. I can understand how this would be concerning, and further aggravating.
    I sincerely apologize for the continued hassle you've experienced with purchasing these appliances. With that said, it appears that you are currently scheduled for delivery on 1/28/15. You should receive a phone call the night before to provide you with a time frame of when to expect them. If you should have any questions or concerns, please feel welcome to reach out to me! 
    Respectfully,
    Tasha|Social Media Specialist | Best Buy® Corporate
     Private Message

  • How can i make this game to be over in 3 minutes?

    i'm really a total beginner, and this is the race game code for my school assignment.
    How can i possibly make this game to be over in 3 minutes?
    It says "game over" when you hit 20 cars.
    I want to make it say "you've made it!" or something when they survive for 3 minutes with less than 20 crashes.
    please help! T.T
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.Timer;
    public class BugRace extends Applet implements KeyListener, Runnable{
      Image buff;
      Canvas Panel;
      Graphics2D gPanel;
      Graphics2D gBuffer;
      Bug redBug;
      Bug[] rivals=new Bug[20];
      Button StartButton;
      //Button StopButton;
      Thread game;
      Timer time;
      private boolean loop=true;
      Dimension dim=new Dimension(200, 300);
      private int road;
      Random rnd=new Random();
      private int crash = 0;
      public void init(){     
        prepareResource();
        setBackground(Color.gray);
        setSize(400,400);
        initPanel();
        add(Panel);
        // Start Button
        StartButton=new Button("START");
        add(StartButton);
        StartButton.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            // request focus for Panel to get key event
            Panel.requestFocus();
            if(!game.isAlive()){
                 game.start();}else if(game.isAlive()){
                 game.start();}
        /*StopButton=new Button("STOP");
        add(StopButton);
        //StopButton.addActionListener(new ActionListener(){
         public void actionPerformed(ActionEvent ae){
            //Panel.requestFocus();
              if(game.isAlive())
                   game.stop();}
      public void prepareResource(){ //load bug images
        Image imgRed=getImage(getCodeBase(),"redbug.gif");
        Image imgBlue=getImage(getCodeBase(),"bluebug.gif");
        Image imgYellow=getImage(getCodeBase(),"yellowbug.gif");
        Image imgPurple=getImage(getCodeBase(),"purplebug.gif");
        MediaTracker mt=new MediaTracker(this);
        try{
          mt.addImage(imgRed, 0);
          mt.addImage(imgBlue, 1);
          mt.addImage(imgYellow, 2);
          mt.addImage(imgPurple, 3);
          mt.waitForAll();
        }catch(Exception e){}
        buff=createImage((int)dim.getWidth(), (int)dim.getHeight());
        gBuffer=(Graphics2D)buff.getGraphics();
        redBug=new Bug(imgRed, 80,250, dim);  // user's bug
        for(int i=0;i<10;i++){
           rivals=new Bug(imgBlue, 0, 0); // rival blue bug
    for(int i=5;i<rivals.length;i++){
    rivals[i]=new Bug(imgYellow, 0, 0); // rival yellow bug
    for(int i=10;i<rivals.length;i++){
    rivals[i]=new Bug(imgPurple, 0, 0); // rival purple bug
    for(int i=0;i<rivals.length;i++){  // set locations for rival bugs
    setrivals(i);
    game=new Thread(this); // game thread for controlling
    public void stop(){
    loop=false; // stop the thread
    public void run(){
    while(loop){
    drawPanel(); // draw game screen
    try{ Thread.sleep(50);}catch(Exception e){}
    public void initPanel(){    // initialize the panel
    Panel=new Canvas(){
    public void paint(Graphics g){
    if(gPanel==null){
         gPanel=(Graphics2D)Panel.getGraphics();
    drawPanel();
    Panel.setSize(dim); // size of the panel
    Panel.addKeyListener(this); //add keylistener for the game
    // set rival bugs' location randomly, and make them not intersect each other
    void setrivals(int en){ 
    int x, y;
    next:while(true){
    x=rnd.nextInt((int)dim.getWidth()-rivals[en].getWidth());
    y=-rnd.nextInt(5000)-200;
    // if (x,y) intersect to each other, go to next
    for(int j=0;j<rivals.length;j++){
    if(j!=en && rivals[j].collision(x, y))continue next;
    // set (x, y) as en rival bug's location and exit from while loop.
    rivals[en].setLocation(x, y);
    break;
    void check(Bug en){       // check if bugs collides
    if(redBug.collision(en)){        // if collide,
    if(redBug.getX()>en.getX()){  // if rival bug is on the left side from user's,            
    en.move(-10, 0); // move rival bug in 10 to the left
    redBug.move(10, 0); // move user's bug in 10 to the right
    crash++;          //add # of crash
    else{                     // if rival bug is on the right side from user's,
    en.move(10,0); // move rival bug in 10 to the right
    redBug.move(-10, 0); // move user's bug in 10 to the left
    crash++;          //add # of crash
    synchronized void drawPanel(){                        // draw panel
    gBuffer.clearRect(0, 0, (int)dim.getWidth(), (int)dim.getHeight()); //clear buffer
    gBuffer.setPaint(new Color(0, 150, 0));          //fill background in green
    gBuffer.fillRect(0, 0, (int)dim.getWidth(), (int)dim.getHeight());
    drawRoad(); // draw the road
    // draw rival bugs moving down
    for(int i=0;i<rivals.length;i++){
    rivals[i].move(0, 15); // move rival bugs down
    rivals[i].draw(gBuffer, Panel); // draw the bugs in panel
    if(rivals[i].getY()>dim.getHeight()){ //if a rival bug is out of panel
         setrivals(i);} // set it at initial position
              check(rivals[i]); // check if they intersect
    redBug.draw(gBuffer, Panel); // draw user's bug
    gPanel.drawImage(buff, 0,0, Panel); // draw buffer in panel
    if(crash<20){
         gPanel.setFont(new Font(null,Font.BOLD,15));
         gPanel.drawString("crash:"+crash,30, 30);}
    else{
         gPanel.setFont(new Font(null,Font.BOLD,15));
         gPanel.drawString("crash:"+crash,30, 30);
         gPanel.setFont(new Font(null,Font.BOLD,20));
         gPanel.drawString("Game Over", 50, 100);
              gPanel.dispose();
    void drawRoad(){ // draw yellow center line
    road+=80;
    gBuffer.setPaint(Color.yellow);
    gBuffer.fillRect((int)dim.getWidth()/2, road,10,150);
    if(road>=dim.getHeight()){ //if the line goes lower than  panel
         road=-150;                    //move it up again
    }else if(crash >20){
         road=0;
    public void keyPressed(KeyEvent ke){       
    if(ke.getKeyCode()==KeyEvent.VK_LEFT){     // if left arrow is pressed,
    redBug.move(-20,0); // the bug moves to the left
    else if(ke.getKeyCode()==KeyEvent.VK_RIGHT){  // if right arrow is pressed
    redBug.move(20,0); // the bug moves to the right
    public void keyReleased(KeyEvent ke){}
    public void keyTyped(KeyEvent ke){}

    import java.util.Timer;
    import java.util.TimerTask;
    public class Test {
        public static void main (String[] args) {
            final Timer timer = new Timer ();
            System.out.println ("I'm gonna do something in 5 seconds.");
            timer.schedule (new TimerTask () {
                public void run () {
                    System.out.println ("Time's up !");
                    timer.cancel ();
            }, 5000);
    }if you want to display the time left it's better to make your own Thread that updates a "timeleft variable:
    {code}
    public class Test {
    //set the time Left to 3 mins.
    private long secondsLeft = 3 * 60;
    public Test () {
    new Thread (new Runnable () {
    public void run () {
    try {
    while (secondsLeft > 0) {
    //Let's update the timer every second.
    Thread.sleep (1000);
    secondsLeft = secondsLeft - 1;
    System.out.println ("Time left: " + (secondsLeft / 60) + ":" + (secondsLeft % 60));
    System.out.println ("Grats !");
    } catch (InterruptedException e) {}
    }).start ();
    public static void main (String[] args) {
    new Test ();
    {code}

  • Does Apple make a monitor that looks like the iMac27, for dual monitor setup?

    I'm thinking about buying an iMac, but I'm used to a multiple monitor setup. Does Apple make a monitor that looks like the iMac27, for dual monitor setup?

    Look at these links.
    http://store.apple.com/us/product/MC914LL/B/apple-thunderbolt-display-27-inch?fn ode=53
    http://store.apple.com/us/product/MC007LL/A/apple-led-cinema-display-(27%22-flat -panel)?fnode=53
    Allan

  • Does increasing ram improves game performance?

    does increasing ram improves game performance of my MBP 13" 2012??

    Using Activity Monitor to read System Memory & determine how much RAM is used
    Adding RAM only makes it possible to run more programs concurrently.  It doesn't speed up the computer nor make games run faster.  What it can do is prevent the system from having to use disk-based VM when it runs out of RAM because you are trying to run too many applications concurrently or using applications that are extremely RAM dependent.  It will improve the performance of applications that run mostly in RAM or when loading programs.

  • My keyboard does not make a noise on the Internet

    MY ipAd makes a noise on games but does not make a noise onthe Internet

    1. Double-click the Home button and swipe Task Bar to the right
    2. Check the volume and mute settings
    http://i1224.photobucket.com/albums/ee374/Diavonex/6d3191ba.jpg

  • Using "Flash Help" to help make flash game?

    Hello,
    I've noticed the other day that in Flash, the "Flash Help (F1)" found under "Help" is licensed under "Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License".  The resources found on adobe.com in the Flash Development Center is also licensed with this.
    The license state:
    " You are free:
        * to Share — to copy, distribute and transmit the work
        * to Remix — to adapt the work
    Under the following conditions:
    Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
    Noncommercial — You may not use this work for commercial purposes.
    Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one."
    - CC License
    I'm trying to learn flash so I can make flash games.  I plan to get them sponsored by game portals and attach them to MochiAds--so technically this would be commercial, yes?
    So does this mean I CAN'T use "Flash Help" or any of the resources found in adobe's Flash Development Center to learn how to use actionscripts?
    Of course I don't plan to bluntly copy-paste codes, but it would be nice if I could adapt and learn how things work.  Sometimes I get stuck and I need a reference...  The last thing I'd want is to get into some copyright trouble =/
    Sorry if this post is out of place.  I tried to ask in Customer Support days ago but I get the feeling that they've ignored me.
    Any extra advices are welcome.
    Thank you,
    Jane

    What is with all the folks asking "copyright" questions lately? Are you all in some class or something? I am not a copyright lawyer so don't take anything I say as the absolute truth, but I have had a long standing interest in these issues...
    Anyways copyright is not an absolute right, there is an important part of copyright law called "fair use" and it is important. Of course it is also the source of a lot of disagreements and law suits...
    A clear case of infringement would be if you tried to just take the Flash help and publish your own "learn actionscript" help book or website.
    But given that the help documentation is meant to teach you how to use the product it seems that it would be clearly within fair use to use it to learn how to use the product.
    And while the US courts have not been particularly intelligent about technical innovation -- often granting patents and copyright to very basic code, while not protecting truly innovative and clever invention -- the argument that the basic instantiation of a class and invocation of its methods, properties, and events, is pretty clearly the only way to do these things. Adobe would have no reason -- in fact they would have quite the opposite -- to pursue a claim against somebody who used actionscript.
    Given the absurdity of the US courts (if here is where you be) just change the names of the variables from the samples and you are most likely fine since it would confuse them.

  • Why can't I make in game purchases with my iTunes gift card?? Help if you no please!!!

    does anyone know why I can't use my iTunes gift card to make in game purchases??? If you know please let me know! Thanks

    What do you mean you can't use it? What happens when you try?
    GB

  • I am making code to try to make a game and my problem is that my code......

    I am making code to try to make a game and my problem is that my code
    will not let it change the hit everytime so im getting the first guy to hit 1 then next hits 8 and so on and always repeats.
    Another problem is that I would like it to attack with out me telling it how much times to attack. I am using Object oriented programming.
    Here is the code for my objects:
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.Random;
    import static java.lang.Math.*;
    import java.awt.*;
    import java.awt.color.*;
    class rockCrab {
         //Wounding formula
         double sL = 70;                                   // my Strength Level
         double bP = 1;                                   // bonus for prayer (is 1 times prayer bonus)
         double aB = 0;                                 // equipment stats
         double eS = (sL * bP) + 3;                         // effective strength
         double bD = floor(1.3 + (eS/10) + (aB/80) + ((eS*aB)/640));     // my base damage
         //Attack formula
         double aL = 50;                                   // my Attack Level
         double eD = 1;                                   // enemy's Defence
         double eA = aL / eD;                              // effective Attack
         double eB = 0;                                   // equipment bonus'
         double bA = ((eA/10) * (eB/10));                    // base attack
         //The hit formula
         double fA = random() * bA;
         double fH = random() * bD;
         double done = rint(fH - fA);
         //health formula
         double health = floor(10 + sL/10 * aL/10);
         rockCrab() {
         void attack() {
              health = floor(10 + sL/10 * aL/10);
              double done = rint(fH - fA);
              fA = random() * bA;
              fH = random() * bD;
              done = rint(fH - fA);
              System.out.println("Rockcrab hit" +done);
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.Random;
    import static java.lang.Math.*;
    import java.awt.*;
    import java.awt.color.*;
    class self {
         //Wounding formula
         double sL = 1;                                   // my Strength Level
         double bP = 1;                                   // bonus for prayer (is 1 times prayer bonus)
         double aB = 0;                                 // equipment stats
         double eS = (sL * bP) + 3;                         // effective strength
         double bD = floor(1.3 + (eS/10) + (aB/80) + ((eS*aB)/640));     // my base damage
         //Attack formula
         double aL = 1;                                   // my Attack Level
         double eD = 1;                                   // enemy's Defence
         double eA = aL / eD;                              // effective Attack
         double eB = 0;                                   // equipment bonus'
         double bA = ((eA/10) * (eB/10));                    // base attack
         //The hit formula
         double fA = random() * bA;
         double fH = random() * bD;
         double done = rint(fH - fA);
         //health formula
         double health = floor(10 + sL/10 * aL/10);
         self() {
         void attack() {
              health = floor(10 + sL/10 * aL/10);
              fA = random() * bA;
              fH = random() * bD;
              done = rint(fH - fA);
              System.out.println("You hit" +done);
    }Here is the main code that writes what the objects do:
    class fight {
         public static void main(String[] args) {
              self instance1 = new self();
              rockCrab instance2 = new rockCrab();
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
    }when the code is run it says something like this:
    you hit 1
    RockCrabs health is 9
    RockCrab hit 7
    your health is 38
    you hit 1
    RockCrabs health is 8
    RockCrab hit 7
    your health is 31
    you hit 1
    RockCrabs health is 7
    RockCrab hit 7
    your health is 24
    you hit 1
    RockCrabs health is 6
    RockCrab hit 7
    your health is 17
    my point is whatever some one hits it always repeats that
    my expected output would have to be something like
    you hit 1
    RockCrabs health is 9
    RockCrab hit 9
    your health is 37
    you hit 3
    RockCrabs health is 6
    RockCrab hit 4
    your health is 33
    you hit 2
    RockCrabs health is 4
    RockCrab hit 7
    your health is 26
    you hit 3
    RockCrabs health is 1
    RockCrab hit 6
    your health is 20
    Edited by: rade134 on Jun 4, 2009 10:58 AM

    [_Crosspost_|http://forums.sun.com/thread.jspa?threadID=5390217] I'm locking.

  • How can I restore a single image from an aperture time machine backup, do I have to restore the entire library? that does not make sense

    I hope there has been found a more efficiant solution for this,  how can I restore a single image from an aperture time machine backup, I really hope I don't have to restore the entire library? that does not make sense
    any suggestions?

    Did you try browsing your backups in the Finder ?  That is, do not go and "Enter Time Machine".  Instead, navigate to your Time Machine backup via Finder and then manually go to the time period (by folder name) you are looking for ... when you find your Aperture library you can then "Show Package Contents" and find the Master you are looking for.

  • I have Firefox 5 now, in the admin section of my web site when I edit a change in the data it does not make the change on my data file. There was no problem in my previous version.

    How can I return to a previous version that did not have problem? On Safari on my lap top Mac, I do not have this problem. We tried this on another Windows computer with a 3.5 or 3.6 Firefox version and there was no problem.

    When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site. Note: this is likely to log you out, so finish up whatever you are working on first.
    1. Clear Firefox's Cache
    orange Firefox button ''or'' Tools menu > Options > Advanced
    On the Network mini-tab > Offline Storage : "Clear Now"
    2. If needed, delete the site's cookies here
    While viewing a page on the site, right-click and choose View Page Info > Security > "View Cookies"
    Then try reloading the page. Does that help?
    Some sites appear to be incompatible with Firefox 5. The difficulty is tracking down the problem. To see whether it is caused by the new stricter HTML parser in Firefox 4+, you can turn that off. Please save any unfinished work first.
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the filter box, type or paste '''html5''' and pause while the list is filtered
    (3) Double-click '''html5.parser.enable''' to toggle it to false (it should turn bold).
    Then return to the problem page, reload and try again. Does that make any difference?
    Here's the process to roll back if needed:
    First, I recommend backing up your Firefox settings in case something goes wrong. See [https://support.mozilla.com/en-US/kb/Backing+up+your+information Backing up your information]. (You can copy your entire Firefox profile folder somewhere outside of the Mozilla folder.)
    Next, download and save Firefox 3.6 to your desktop for future installation. http://www.mozilla.com/firefox/all-older
    Close Firefox 5.
    You could install Firefox 3.6 over it (many have reported success) or you could uninstall Firefox first. If you uninstall, do not remove your personal data and settings, just the program.
    Unless you have installed an incompatible add-on, Firefox 3.6 should pick up where you left off. If there are serious issues, please post back with details.

  • HT3053 Can I run my MacBook Pro Late 2008 without battery forever? Is it bad in long term or anything? Does it make the system less stable?

    Can I run my MacBook Pro Late 2008 without battery forever? Is it bad in long term or anything? Does it make the system less stable?
    My battery got swollen (and I unfortunately noticed it very late and might have be running with it for months, which potentially explains all the crashes everyday and the trackpad not working anymore, the Apple test also says I have a bar of ram broken...) and I had to remove it because the back pannel did not close anymore... Can I still use my MBP normally forever that way? I was planning on buying a new mac anyway but maybe waiting for the next iMac upgrade in the year... Should I wait?

    Other than the system shutting down instantly if you have a power outage, whcih could corrupt the OS. Nothing else bad will happen.

  • If you buy a itunes gift card, can you use it to make in game/app purchases?

    if you buy a itunes gift card, can you use it to make in game/app purchases?

    Thank you

  • IPhone 4 does not make or receive calls/text at a location it used to.HELP!

    I started experiencing this sometime last week. It does not make any sense to me so I ask you. My phone does not make or receive phone calls and texts while I am at my workplace. It had worked find from when I got the phone (Late August) through January. If it stopped working completely I'd figure it was a dead zone or something, although they do not just pop up out of nowhere. But it works sporadically. Like if i got to send a text maybe 1 out of every 4 will work, same with receiving them. And this is the same with phone calls. I will receive a call, get through maybe 15 seconds of it, then the call gets dropped. Then for the remainder of the day (as I do not use it much during work) it will not receive a call, it goes right to voicemail. I have tested this by repeatedly calling my phone from my work landline. It rings fine on that end, so others wouldn't suspect I am having an issue, and goes to voicemail. I left a voicemail and my phone did not alert me to it for over 10 minutes (it never told me I had a missed call) During this timeframe I also attempted to make phone calls from my iPhone, they would not ring, it would immediately drop. But again, it is sporadic. So after 5 or 6 times of attempting making phone calls one goes through. I had made an appointment at the Apple Store the first day that this happened but once I was on the road to the store I got all my texts, voicemails, pictures that I had attempted to send earlier, so I thought it pointless since I had no real proof of this happening. But now it seems to happen everyday, it just happened which prompted me to write this. Again, its only at work, and only recently started happening. There is no cell tower issue, everyone elses phone works here. I have turned off the phone, both a soft and hard reset, reset network setting, turned off/on 3G, Cell Data, taken out the SIM, moved it, etc. Everything short of getting another phone, but it works perfectly fine everywhere else. Any ideas???

    I ended up taking my phone in to the Genius Bar, but we were unable to diagnose the problem. The genius said she had never seen anything like this before. We tried everything to figure out if it was hardware or software related, but never concluded anything. Instead of paying >$150 to fix/replace, I bought the iPhone5. iPhone5 is amazing. Maybe it was fate.

Maybe you are looking for

  • New iTunes 11.01.12 won't allow sync to PC if iCloud is also enabled

    I upgraded today to itunes 11.01.12 (not sure what version I had previously - it was quite different visually but not very out-of-date). I have a "notes" account on my iphone which I sync to outlook on windows. Most of my notes are in this account. I

  • Progress bar on startup

    Hi Guys, I keep getting a progress bar on startup. Not every time, but at least every few days. I've had this before since installing Mavericks and eventually my drive was not reparable in disk utility and I had to do a clean install and start from s

  • Macbook Pro to 20" Cinema with Bootcamp = main screen?

    I have a 20" Cinema Display and a late 2008 black/silver Macbook Pro. I am thinking of going bootcamp with Windows XP and use the external adaptor and 20" cinema as my main screen. Will this become my "main screen"? Or will the Windows task bar and m

  • Mac mini and mouse: Curious bug

    My Mac mini shows a quite curious bug. When I move the mouse while logging off an user - whether an admin or one with restricted rights - the mouse freezes. I have to log in and off again to make the mouse move again. I changed the mouses and re-inst

  • Dreamweaver css3-html5 colornames

    darkgray means something to me. But honestly, #999999 ...what's that? Browsers all know css3-html5 colorname css syntax, but where are colornames in Dreamweaver? When I am in code view and inserting color property, the only Dreamweaver popup  is an a