Moving the ball

public class Ball extends JFrame implements Runnable
     int x = 10;          
     int y = 100;     
     int radius = 20;     
     public Ballbewegung1()
          super("Ball Moving");
          setBackground (Color.blue);
          start();
          setSize(400,400);
          setVisible(true);
     public static void main(String[]args)
          Ballbewegung1 test = new Ballbewegung1();
          test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     public void start ()
          Thread th = new Thread (this);
          th.start ();
          System.out.println("Start");
     public void run ()
          Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
          while (x<=300)
               x ++;
               repaint();
               try
                    Thread.sleep (20);
               catch (InterruptedException ex)
               Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
     public void paint (Graphics g)
          g.setColor  (Color.red);
          g.fillOval (x - radius, y - radius, 2 * radius, 2 * radius);
}i not sure what wrong with my coding because it keep coming up the wrong out put.Any help will greatly appreciated. Thank you

Maybe this code is your desired affect. This uses active render rather than depending the OS and java to repaint the screen. I prefer active rendering when possible. You can't use it if you have menu's or some other component that comes down into the painted area (or at least I haven't figured out how to solve the problem that when your component is painted it covers the menu...something java takes care of when using repaint()).
Also, I went ahead a drew on your JFrame but as mentioned above it would be better to put a JPanel in the JFrame and draw on the JPanel. So basically create a class that extends JPanel and put this functionality in it and then add the JPanel to your top level JFrame. The flicker would go away if you drew on an off screen image and then moved it to the screen (at the end of the render method).
The Timer method is the preferred method (rather than Thread.sleep) as the action it executes is executed form the Event Dispatcher Thread.
Enjoy:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
public class Ball extends JFrame {
     private int x = 10;
     private int y = 100;
    private int radius = 20;
    private Timer animationTimer;
     public Ball() {
          super("Ball Moving");
          this.setSize(400,400);
          this.setVisible(true);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.startAnimation();
     private void startAnimation() {
        Action animate = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                render();
        this.animationTimer = new Timer(4, animate);
        this.animationTimer.start();
     private void render() {
        Graphics g = getGraphics();
        g.setColor(Color.blue);
        g.fillRect(0, 0, this.getSize().width, this.getSize().height);
          g.setColor(Color.red);
          g.fillOval(x - radius, y - radius, 2 * radius, 2 * radius);
        x = x + 1;
        if (x > 300) {
            this.animationTimer.stop();
    public static void main(String[]args) {
        new Ball();
}

Similar Messages

  • I go to "clip adjustments" and change the length of a photo. It reverts back to original length. I also shorten it by moving the yellow "box" around a specific clip. It still reverts back to original length. Why?

    I go to "clip adjustments" and change the length of a clip. It reverts back to original length. I've also tried to shorten it by moving the yellow "box" around a specific clip to shorten. It still reverts back to original length. Why?

    Welcome to iMovie Discussions.
    See my 2nd reply to 'getzcreative', here.

  • Why aren't the Balls Bouncing  ? HELP !

    Dear Java People,
    In doing a program that should have balls bouncing, I can see no balls bouncing !
    Below is the BallDemo class that has the bounce() method and the BouncingBall class that has the characteristics of a bouncing ball.
    There are no compilation errors which makes it a little bit
    difficult to find the error.
    Thank you in advance
    Stan
    import java.awt.*;
    //(d)
    import java.awt.Color;
    import java.util.Random;
    import java.awt.geom.*;
    //ex5.50 (a)
    import java.util.*;
    import java.io.*;
    * Class BallDemo - provides two short demonstrations showing how to use the
    * Canvas class.
    //(a) Change the bounce() method in the BallDemo class to let the user
    //choose how many balls should be bouncing
    //(b) Use a collection to store the balls
    //(c) Place the balls in a row along the top of the canvas.
    public class BallDemo
        private Canvas myCanvas;
        FormattedInput input;
         * Create a BallDemo object. Creates a fresh canvas and makes it visible.
        public BallDemo()
            myCanvas = new Canvas("Ball Demo", 600, 500);
            input = new FormattedInput();
            myCanvas.setVisible(true);
         * This method demonstrates some of the drawing operations that are
         * available on a Canvas object.
        public void drawDemo()
            myCanvas.setFont(new Font("helvetica", Font.BOLD, 14));
            myCanvas.setForegroundColor(Color.red);
            myCanvas.drawString("We can draw text, ...", 20, 50);
            myCanvas.wait(1000);
            myCanvas.setForegroundColor(Color.black);
            myCanvas.drawString("...draw lines...", 60, 70);
            myCanvas.wait(500);
            myCanvas.setForegroundColor(Color.blue);
            myCanvas.drawLine(200, 20, 300, 450);
            myCanvas.wait(500);
            myCanvas.setForegroundColor(Color.blue);
            myCanvas.drawLine(220, 100, 570, 260);
            myCanvas.wait(500);
            myCanvas.setForegroundColor(Color.green);
            myCanvas.drawLine(290, 10, 620, 220);
            myCanvas.wait(1000);
            myCanvas.setForegroundColor(Color.white);
            myCanvas.drawString("...and shapes!", 110, 90);
            myCanvas.setForegroundColor(Color.red);
                    // the shape to draw and move
            int xPos = 10;
            Rectangle rect = new Rectangle(xPos, 150, 30, 20);
            // move the rectangle across the screen
            for(int i = 0; i < 200; i ++) {
                myCanvas.fill(rect);
                myCanvas.wait(10);
                myCanvas.erase(rect);
                xPos++;
                rect.setLocation(xPos, 150);
            // at the end of the move, draw once more so that it remains visible
            myCanvas.fill(rect);
           //ex 5.48
           public void drawFrame()
             Dimension myDimension =new Dimension( myCanvas.getSize());
             //Rectangle rectangle = new Rectangle(10,10,myDimension.width,  myDimension.height);
             //page 136
            Rectangle rectangle = new Rectangle(10,10,580,480);
             myCanvas.fill(rectangle);
         * Simulates two bouncing balls
        public void bounce()
            int ground = 400;   // position of the ground line
            int numberOfBalls = 0;
            myCanvas.setVisible(true);
            ArrayList balls = new ArrayList();
            // draw the ground
            myCanvas.drawLine(50, ground, 550, ground);
            //ex 5.50 (a)
            System.out.println("Type in the number of balls you would like to see bouncing and hit enter");
              numberOfBalls = input.readInt();
             //(b)
             for(int i = 0; i < numberOfBalls; i++)
               //(c) (d)
            Random rg = new Random(255);
             BouncingBall newBall =  new BouncingBall(i + 100, 0, 16, new Color(rg.nextInt(255),rg.nextInt(255),rg.nextInt(255)), ground, myCanvas);
             //add the ball to the ArrayList object
            balls.add(newBall);
           for(int i = 0; i < numberOfBalls; i++)
                  BouncingBall ball = (BouncingBall)balls.get(i);
                  ball.draw();
              // make the balls bounce
              boolean finished =  false;
              while(!finished) {
               myCanvas.wait(50);           // small delay
               ball.move();
                // stop once ball has travelled a certain distance on x axis
                if(ball.getXPosition() >= 550 )
                    finished = true;
            }//move loop
                  ball.erase();
          }//for loop
        }//bounce method
    }//endof class
    ===================================================================
    import java.awt.*;
    import java.awt.geom.*;
    * Class BouncingBall - a graphical ball that observes the effect of gravity. The ball
    * has the ability to move. Details of movement are determined by the ball itself. It
    * will fall downwards, accelerating with time due to the effect of gravity, and bounce
    * upward again when hitting the ground.
    * This movement can be initiated by repeated calls to the "move" method.
    public class BouncingBall
        private static final int gravity = 3;  // effect of gravity
        private int ballDegradation = 2;
        private Ellipse2D.Double circle;
        private Color color;
        private int diameter;
        private int xPosition;
        private int yPosition;
        private final int groundPosition;      // y position of ground
        private Canvas canvas;
        private int ySpeed = 1;                // initial downward speed
         * Constructor for objects of class BouncingBall
         * @param xPos  the horizontal coordinate of the ball
         * @param yPos  the vertical coordinate of the ball
         * @param ballDiameter  the diameter (in pixels) of the ball
         * @param ballColor  the color of the ball
         * @param groundPos  the position of the ground (where the wall will bounce)
         * @param drawingCanvas  the canvas to draw this ball on
        public BouncingBall(int xPos, int yPos, int ballDiameter, Color ballColor,
                            int groundPos, Canvas drawingCanvas)
            xPosition = xPos;
            yPosition = yPos;
            color = ballColor;
            diameter = ballDiameter;
            groundPosition = groundPos;
            canvas = drawingCanvas;
         * Draw this ball at its current position onto the canvas.
        public void draw()
            canvas.setForegroundColor(color);
            canvas.fillCircle(xPosition, yPosition, diameter);
         * Erase this ball at its current position.
        public void erase()
            canvas.eraseCircle(xPosition, yPosition, diameter);
         * Move this ball according to its position and speed and redraw.
        public void move()
            // remove from canvas at the current position
            erase();
            // compute new position
            ySpeed += gravity;
            yPosition += ySpeed;
            xPosition +=2;
            // check if it has hit the ground
            if(yPosition >= (groundPosition - diameter) && ySpeed > 0) {
                yPosition = (int)(groundPosition - diameter);
                ySpeed = -ySpeed + ballDegradation;
            // draw again at new position
            draw();
         * return the horizontal position of this ball
        public int getXPosition()
            return xPosition;
         * return the vertical position of this ball
        public int getYPosition()
            return yPosition;
    }

    I'm not reading all of that. what do you see? here, try this out.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.awt.geom.*;
    public class BallRoom extends Applet implements Runnable, MouseListener, ActionListener {
         Thread thread;
         Rectangle border;
         Ball[] theBalls;
         int numberOfBalls = 10;
         Image bufferedScreen;
         Graphics2D bufferedG;
         double xSpeed=3.0, ySpeed=0.0;
         double gravity=1.2;
         int bounds=600;
         int speed=50;
         Button fastBut=new Button("Faster"), slowBut=new Button("Slower");
         Panel controlPanel = new Panel();
         public void init() {
              fastBut.addActionListener(this);
              slowBut.addActionListener(this);
              controlPanel.setLayout(new GridLayout(1,2));
              controlPanel.add(fastBut);
              controlPanel.add(slowBut);
              this.add(controlPanel);
              addMouseListener(this);
              theBalls = new Ball[numberOfBalls];
              setSize(bounds,bounds);
              border = new Rectangle(0,0,getSize().width,getSize().height);
              setBackground(Color.white);
              for(int a=0;a<numberOfBalls;a++){
                   theBalls[a]=new Ball(Math.random()*bounds,Math.random()*bounds,Math.random()*40+5,new Color((int)(Math.random()*255),(int)(Math.random()*255),(int)(Math.random()*255)),border,gravity);
         public void start() {
              thread = new Thread(this);
              thread.start();
         public void run() {
              Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
              for(int a=0;a<numberOfBalls;a++){
                   theBalls[a].moveIt((int)(10-Math.random()*20),(int)(10-Math.random()*20));
              while(true){
                   for(int a=0;a<numberOfBalls;a++){
                        theBalls[a].moveIt();
                        for(int b=a+1;b<numberOfBalls;b++){
                             if(theBalls[a].intersects(theBalls)){
                                  swapSpeeds(theBalls[a],theBalls[b]);
                   repaint();
                   try{
                        thread.sleep(speed);
                   }catch(InterruptedException ex){
         public void swapSpeeds(Ball one, Ball two){
              double xVone=one.getxV();
              double yVone=one.getyV();
              double xVtwo=two.getxV();
              double yVtwo=two.getyV();
              one.setSpeeds(xVtwo,yVtwo);
              two.setSpeeds(xVone,yVone);
                   one.moveIt();
                   two.moveIt();
         public void paint(Graphics g) {
              g.setColor(Color.black);
              for(int a=0;a<numberOfBalls;a++){
                   theBalls[a].drawBall(g);
              Point2D.Double pointa=theBalls[0].getCenter();
              Point2D.Double pointb=theBalls[1].getCenter();
              double distance = pointa.distance(pointb);
              double deltaX = pointa.getX()-pointb.getX();
              double xSpot=theBalls[2].getX();
              double ySpot=theBalls[2].getY();
              g.drawString("X :"+String.valueOf(xSpot),20,20);
              g.drawString("Y :"+String.valueOf(ySpot),20,30);
              g.drawString("speed :"+String.valueOf(speed),20,40);
         public void update(Graphics g) {
              if(bufferedScreen==null){
                   bufferedScreen=createImage(getSize().width,getSize().height);
              bufferedG=(Graphics2D)(bufferedScreen.getGraphics());
              bufferedG.setColor(getBackground());
              bufferedG.fillRect(0,0,getSize().width,getSize().height);
              paint(bufferedG);
              g.drawImage(bufferedScreen,0,0,this);
    public void actionPerformed(ActionEvent e) {
              java.awt.Toolkit.getDefaultToolkit().beep();
              Button source = (Button)e.getSource();
              if(source==fastBut){
                   speed=speed-5;
                   if(speed<0){speed=0;}
              if(source==slowBut){
                   speed=speed+5;
         public void mousePressed(MouseEvent m){
              for (int a=0;a<numberOfBalls;a++){
                   if (theBalls[a].contains(m.getPoint())){
                        theBalls[a].setSpeeds( (5-(int)(Math.random()*10)),(int)(-40*(Math.random())) );
         public void mouseEntered(MouseEvent m){mousePressed(m);}
         public void mouseReleased(MouseEvent m){mousePressed(m);}
         public void mouseClicked(MouseEvent m){}
         public void mouseExited(MouseEvent m){}
    and this..
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    public class Ball extends Rectangle2D.Double {
         double a;                              //acceleration
         double yV=0, yVi=0, xV=0, xVi=0;     //velocity and initial velocity
         double t=1;                                       //time
         double roomWidth, roomHeight;
         double x_pos, y_pos;
         double ballDiam;
         double spring=.9;
         Rectangle room;
         Color color;
         Point2D.Double center;
         Ball(double x, double y, double diameter, Color color, Rectangle walls, double gravity) {
              a=gravity;
              room=walls;
              roomWidth=room.getSize().width;
              roomHeight=room.getSize().height;
              ballDiam=diameter;
              x_pos=x;
              y_pos=y;
              setRect(x,y,ballDiam,ballDiam);
              this.color=color;
              center = new Point2D.Double(x,y);
         public void moveIt() {
              setRect(xMove(),yMove(),ballDiam,ballDiam);
         public void moveIt(double x, double y) {
              setRect(xMove(x),yMove(y),ballDiam,ballDiam);
         public double xMove(double currentSpeed) {
              x_pos=getX();
              xV=currentSpeed;
              x_pos=x_pos+xV*t;
              return x_pos;
         public double xMove() {
              x_pos=getX();
              x_pos=x_pos+xV*t;
              if((x_pos<0) & ( xV<0  ) | ((x_pos>(roomWidth-ballDiam)) & ( xV>0  ))){
                   xV*= (-spring);
              return x_pos;
         public double yMove(double currentSpeed) {
              y_pos=getY();
              yVi=currentSpeed;
              yV=yVi+a*t;
              y_pos=y_pos+yV*t+.5*a*t*t;
              return y_pos;
         public double yMove() {
              double grav=a;
              if((y_pos>(roomHeight-(ballDiam+1)))|(y_pos<0)){ //negates gravity during impact
                   a=0;
                   if (y_pos<1 & y_pos>-.6){
                        yV=0;
              y_pos=getY();
              yVi=yV;
              yV=yVi+a*t;
              y_pos=y_pos+yV*t+.5*a*t*t;
              if((y_pos>(roomHeight-ballDiam)) & ( yV>0  )){
                   y_pos=roomHeight-ballDiam;
                   yV*= (-spring);
              if (y_pos<0 &  yV<0){
                   yV*= (-spring);
              a=grav;
              return y_pos;
         public void drawBall(Graphics g) {
              g.setColor(color);
              g.fillOval((int)getX(),(int)getY(),(int)ballDiam,(int)ballDiam);
              g.setColor(Color.black);
              g.drawOval((int)getX(),(int)getY(),(int)ballDiam,(int)ballDiam);
              g.drawString(String.valueOf(yV),(int)x_pos,(int)y_pos);
         public Point2D.Double getCenter(){
              center.setLocation(x_pos+.5*ballDiam,y_pos+.5*ballDiam);
              return center;
         public double getxV(){
              return xV;
         public double getyV() {
              return yV;
         public void setSpeeds(double x,double y){
              xV=x;
              yV=y;

  • Excel Upload and moving the data to dynamic itab

    Hi Folks,
    I am building a fieldcatalog dynamically based on the table name and then creating a dynamic internal table based on the fieldcatalog.Now I have a excel sheet having the fields in the same structure as the fieldcatalog that I built.I want to upload the data in the excel to an internal table having the structure of the fieldcatalog I built.I am having a problem in moving the data from the excel to the itab (dynamic itab built based on the fieldcatalog)
    1.Building the fieldcatalog.
    data:gt_fieldcat    TYPE lvc_t_fcat.
      ls_fieldcat-tabname    = p_tabname.
      ls_fieldcat-fieldname  = p_fieldname.  
      ls_fieldcat-inttype    = 'C'.
      ls_fieldcat-outputlen  = wa_dfies-outputlen.   
      ls_fieldcat-coltext    = wa_dfies-fieldtext.
      APPEND: ls_fieldcat TO gt_fieldcat.
      CLEAR : ls_fieldcat.
    2.Building the dynamic itab
    DATA:gp_table       TYPE REF TO data.
    FIELD-SYMBOLS: <gt_table> TYPE table,
    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = gt_fieldcat
        IMPORTING
          ep_table        = gp_table.
      ASSIGN gp_table->* TO <gt_table>.
    3.Now I have an excel with a similar structure with data.Uploading the excel data into itab.
    DATA: g_t_xltab  TYPE STANDARD TABLE OF ty_xltab,
          it_rawdata TYPE truxs_t_text_data,
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
    *     I_FIELD_SEPERATOR    =
          i_line_header        = 'X'
          i_tab_raw_data       = it_rawdata
          i_filename           = xls_filename
        TABLES
          i_tab_converted_data = g_t_xltab[]
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      Endif.
    *Move the data that got uploaded from excel into
    *respective internal tables.
        LOOP AT g_t_xltab
        here I want move the data into an internal table having the structure I built using
        the fieldcatalog/dynamic itab ie    <gt_table>.
        Endloop.
    I tried using ASSIGN COMPONENT sy-index of <gt_table> and move-corresponding but in vain as I am not that much familiar with dynamic itab using field symbols.Kindly let me know how the excel data can be moved to dynamic itab.
    Thanks,
    K.Kiran.

    Hi,
    you can try some logic like this. Please note this is just an example
    TYPE-POOLS:truxs.
    TYPES:BEGIN OF ty_xltab,
          field TYPE string,
          END OF ty_xltab.
    DATA:wa TYPE ty_xltab.
    DATA:lv_len TYPE i.
    DATA:startpos TYPE i.
    FIELD-SYMBOLS:<fs_line> TYPE mara.
    FIELD-SYMBOLS:<fs> TYPE ANY.
    DATA: g_t_xltab  TYPE STANDARD TABLE OF ty_xltab,
          it_rawdata TYPE truxs_t_text_data.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
    *     I_FIELD_SEPERATOR    =
          i_line_header        = 'X'
          i_tab_raw_data       = it_rawdata
          i_filename           = ' '
        TABLES
          i_tab_converted_data = g_t_xltab[]
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
    IF sy-subrc  <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    startpos = 0.
    LOOP AT g_t_xltab INTO wa.
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE <fs_line> TO <fs>.
        IF sy-subrc = 0.
          DESCRIBE FIELD <fs> OUTPUT-LENGTH lv_len.
          IF lv_len > 0.
            <fs> = wa-field+startpos(lv_len).
            startpos = startpos + lv_len.
          ENDIF.
        ELSE.
          append <fs_line> to <fs_tab>.
          EXIT.
        ENDIF.
      ENDDO.
    ENDLOOP.
    Sorry my answer is not for you requirement..Please Ignore.
    Your solution can be easily solved by looking at the concept Assign component . Please search
    Edited by: Keshav.T on Nov 7, 2011 1:42 PM

  • I downloaded a program on my macbook pro and moved the file now everytime i open the program it says repair now...how do i fix that

    i downloaded a program and moved the file from which it was orignally downloaded now everytime i open it it says repair now...what do i do to get it to stop doing that...i hit repair now every time and it still says it everytime upon the programs startup

    Photoshop needs to be in the folder within Applications in which it was originally created. Put it back where you got it.
    Did you actually complete the download process or were you maybe running from the .dmg that you downloaded?

  • I'm using ezcap.tv 116 ezgamer capture card to record my PS3, this is on a windows laptop, Im then moving the recorded videos in mpg format over to my MacBook Pro to use IMovie to edit them to upload to youtube but it won't let me import them.

    I'm using ezcap.tv 116 ezgamer capture card to record my PS3, this is on a windows laptop, Im then moving the recorded videos in mpg format over to my MacBook Pro to use IMovie to edit them so i can upload them to youtube but it won't let me import them, even after changeing them to MP4 format, it just comes up with the message: "No Importable Files None of the selected files or folders can be imported. Change the selection and try again."
    Ive even tried opening in itunes and copying from thier but they wont open in Itunes, no message or anything they simple just dont open. its strange because it does open in quicktime player.
    please if anyone has any ideas that can help me please let me know XD thanks.

    First problem: You're fine. The hotter it gets, the more the fans spin up. The computer is designed so that at max load, at max fan speed, it won't overheat (unless it's obstructed by something, e.g. sitting on your bed swallowed by a comforter). It's not the best thing to keep it that toasty for days at a time, but a couple hours at a time shouldn't be a problem.
    Second problem: If something in the trash won't delete, just use Secure Empty Trash and it should be fine. Since .torrent files are quite small, it should only take a couple seconds.

  • How do you move an Event Library without moving the physical media

    I've got a large library of media that needs to be organized, with new keywords.  I have multiple people on different computers attacking portions of the media all stored on a single raid, accessed via gigabit ethernet.  When the libraries are created on each computer, the media is kept in it's original place.  Because the drive is networked, FCP X won't let me place the Event Library on the drive, though I can access the media.  It will also not let me move or duplicate the libraries to the networked drive.  If I connect a drive locally, I can move, copy or duplicate the Event Library, but, here's the problem, instead of copying the alias' to the media, and keeping it like the original event library, it copies the full media into the new library, unnecessarily.
    Has anybody found how to copy the Copy, Move or Duplicate the Event Libraries without moving the actual media to the new Library?  I'd like to copy the new libraries to the networked drive where the media is stored and then relink the files.  Then I could merge each computers Library into a master library.
    Does that make sense to anybody?  There has to be a way to stop FCP X from unnecessarily copying the media.

    Not sure if this is what you're looking for but - Did you uncheck 'Copy files to Final Cut Events Folder' when importing into your project?

  • Why does moving the mouse over an IMAQ image display slow the GUI down so much?

    I have a large application with several vi's running simultaneously under labview 8.6.1.  When I mouse over an image display control in one of the vi's, everything slows down a shocking amount in all the other vi's.  The windows task manager does not show a large increase in CPU use.  My pc is has a quad cpu with 4GB of RAM, and the CPU and memory loads do not appear to be terribly taxing to the system.  However, many of my vi's apparently come almost to a standstill if I just move the mouse in a circle around my image control.
    This looks like it is largely a GUI display issue.  If I make a new vi and put a while loop in it that only displays the iteration loop number to an indicator, I can see the iterating occurring, then stopping totally when I mouse inside the image display control.  When I stop moving the mouse inside the control, or when I move it outside the control, the interation loop number jumps up, as if it had been incrementing behind the scenes the whole time.  So only display of the interating was halted.
    This problem occurs even if the vi with the image control is not executing.  If the vi with the image control is open but not running, and I mouse over the image on it, the other guis all come to a screeching halt.
    Does mousing in the image display control really utterly crush all other guis in all other labview windows?  Is this an issue inherent to the image display control?  If so, is there anything I can do about this? 
    Also, this issue is not entirely limited to display.  I started looking at it in greater detail because this issue also exposed what I think is a race condition in my code.  I have a vi that acquires an image from a ccd and puts it into an IMAQ image.ctl.  This image then gets passed up to a vi up the call chain, and is put on a queue and sent over to be de-queued by a vi that has the image display control.  Here's the kicker:  when I mouse over the image display control, the image successfully gets acquired inside the subvi, and if I probe the wire leading to the output IMAQ image display.ctl, I see the image.  If I simultaneously probe the wire coming out of the subvi one level up the call chain, the image gets lost about half the time.  This only happens if I am mousing in the image display control IN A TOTALLY DIFFERENT AND SEPARATE VI.  If I bump up the priority of the ccd image acquisition vi to 'highest priority', the problem only happens about 1% of the time, and I really have to mouse around to make it happen.  Still, it's disturbing that mousing in the GUI in one window results in a failure of a separate subvi to simply pass an image up the call chain.  I understand that IMAQ images are referenced rather than passed by value, but I don't see why there should be a failure to pass the image up the call chain.  I've looked for a race condition, but can't find one.
    Eric

    I have finally been able to replicate the behavior that you are seeing on another computer once the image was large enough.  Here are a few notes about this behavior:
    First. The UI only slows down when the images are large, 16 bit images.  The reason why this is unique to 16 bit images is that they can only be displayed on the front panel as 8 bit images.  The workaround that Weiyuan suggested to change the 16 bit display mapping hints towards the root of the problem...that any time a mouse runs over the indicator, Windows asks the entire image to re-draw (having a separate indicator overlapping the image will create the same behavior).  With a 16 bit image, not only does the image have to re-draw on the screen but the 16 bit pixels need to be mapped to 8 bits.  When setting the 16 bit display mapping to Full Dynamic, this requires mor computation/pixel than 90% dynamic or one of the other mapping schemes.
    This is expected behavior if your program is running and you're trying to display a large 16 bit image.  To fix this behavior there are a couple options:
    Change the 16 bit display mapping to something other than full dynamic.  You can choose which 8 bits to display or if you want to map the bits. 
    Resize the image just for viewing purposes on your front panel (since you aren't going to view every single pixel of you image on the screen). You can use the IMAQ Resample.vi to do this.  This will allow you to take your 1500x1500 pixel image and only display a 500x500 pixel version.
    If you are interested in viewing small details of the large image, consider just displaying a smaller region of interest at a time.
    Let me know if any of these solutions work for you.  Good luck on your application.
    Zach C.
    Field Engineer
    Greater Los Angeles

  • How do I stream purchased movies to my Macbook Pro if I've already downloaded them and moved the source files to an external desktop hard drive and I'm away from home?

    I recently added a number of movies to my iTunes library by redeeming digital copeis that came with Blu-rays. Due to limted disc space on my MacBook Pro, and for safe keeping, once I downloaded the movies, I moved the source files to an external desktop hard drive. When I'm home and I'm able to access that external HD via my home network, I'm able to watch the movies without an issue. However, if I'm away from home and I want to watch them, I'm not sure how to do that. I thought I could "stream" purchased movies from within iTunes  - even after downloading them - using "iTunes in the Cloud" but can't figure out how to do that, or it simply isn't possible.
    What are my options?

    I understand that I can't play my downloaded movies when my external HDD is not connected becuase iTunes is looking for the downloaded files. This is not the issue. The issue is that because my HDD is not connected (as in when I'm away from home) I'd like to be able to stream the movies via the cloud.
    If I hadn't downloaded the movies when I redeemed my codes, would I have been able to keep the movies online via Apple iCloud and watched them anytime by streaming them or must the movies be downloaded in order to be viewed on my MacBook?  I read that Apple allows movies purchased (or redeemed) via iTunes to be stored in the cloud via Apple iCloud so that they can be viewed any time, on any device.  IF this is the case, how does it work? From what I can see, it looks like movies can only be "streamed" from the cloud when useing Apple TV; on my iPhone and MacBook Pro, it looks like they need to be downloaded in order to be viewed.
    Can someone clarify this for me?
    Also - Michael - when you said that If I've already downloaded the film but I'm away from my external HDD I should "Delete the entry from the iTunes library so iTunes only sees the iTunes in the Cloud version", what exactly would this mean? Would this mean that I could then stream the movie from the cloud or would I have to re-download it to my Mac's internal HDD in order to watch it?
    Many thanks!

  • HT1495 My Wife and I have separate accounts on the same Macbook Pro.  I have moved the iTunes library to a shared area and we can both access it, however, my Wife (secondary user)can't import cd's. Is there something we are missing and is there a way to d

    My Wife and I have separate accounts on the same Macbook Pro.  I have moved the iTunes library to a shared area and we can both access it, however, my Wife (secondary user)can't import cd's. Is there something we are missing and is there a way to do this?

    You are more likely to get relavant and useful suggestions posting to the Mac forums instead of the iTunes for Windows forum where you've posted.

  • Upgraded to FF4 sites were slow loading or not loading at all - then I discovered it downloads if I keep moving the cursor. If I stop moving the cursor the downloading stops or slows to a crawl again.

    Upgraded to FF4 sites were slow loading or not loading at all - then I discovered it downloads if I keep moving the cursor. If I stop moving the cursor the downloading stops or slows to a crawl again. What do I do so no need to keep having to move cursor?THE DOWNLOADING ICON STOPS MOVING UNLESS I KEEP MOVING THE CURSOR AROUND.

    Clear Cookies & Cache
    * https://support.mozilla.com/en-US/kb/Template:clearCookiesCache
    Clear the Network Cache
    * https://support.mozilla.com/en-US/kb/How%20to%20clear%20the%20cache#w_clear-the-cache
    Troubleshooting extensions and themes
    * https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes
    Check and tell if its working.

  • I moved the mobilesync path where my backups should be stored. However, since then I moved some folders around which I think is the source of my error. I can no longer backup my iphone. How do I fix this?

    A while ago, I moved the mobilesync path so that it would stop trying to backup onto my C drive. However, since then I moved some folders around which I think is the source of my error. I can no longer backup my iphone It just tells me that the backup is corrupted. When i go to preferences, devices, and look under backups it is empty. How do I fix this?

    Howdy there mjspace1994,
    It sounds like you are unable to backup your phone after moving the mobile sync folder from its default location. If moving it back manually does not resolve the issue, I would next use either of the following articles to remove iTunes from your computer and then re install it. The articles outline the proper order to remove them in, and step by step instructions:
    Remove and Reinstall iTunes and other software components from Windows XP
    Remove and reinstall iTunes and related software components for Windows Vista, Windows 7, or Windows 8
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • Moving the iMovie app to an external drive

    I currently download a lot of video each day into iMovie and I am constantly running into an issue where I am out of hard-drive disk space. It really limits how much video I can work on at one time. I called and spoke with a member of the Apple Support App Team and he advised that I move the iMovie app to an external hard drive to resolve the issue. I have since done that, but the video clips are still saving to my internal hard-drive instead of the external hard-drive where the app is. When I moved the iMovie app to the external hard-drive, I disconnected the external hard-drive and deleted the app from my internal hard-drive. After emptying the trash, I re-connected the external hard-drive and opened iMovie and began importing movie clips. A little while later, I ran Omni Disk Sweeper and all of the clips that I imported still show on my internal and meanwhile, the external's capacity is only showing the iMovie app itself and no clips. Any ideas on how I can route the clips to the external instead of my Mac's internal hard-drive?

    Instead of moving the iMovie application, click here and follow the instructions.
    (123002)

  • Dear all, I have a MacBook Pro bought in April 2011. Last April, it got stuck while the wheel was spinning and I had to force it shut. That cost me my hard drive. Now, it's stuck again. I tried esc, cmd tab, moving the trackpad on the apple, but no. HELP!

    Dear all, I have a MacBook Pro bought in April 2011. Last April, it got stuck while the wheel was spinning and I had to force it shut. That cost me my hard drive. Now, it's stuck again. I tried esc, cmd+tab, moving the trackpad on the apple, but no. HELP!

    Dear John,
    thank you for your prompt reply. After I sent the email, I left the wheel spinning to see if it would eventually stop. It didn't, but after a while the screen turned blue, so I decided to switch everything off with a forced shut-down. I could not restart with the OS DVDs because I am currently away from home, but fortunately everything was more or less fine after restarting. It then got stuck again, I forced it shut again, restarted again, and now it seem to work but I won't overdo it and will switch off smoothly after writing this (unless it gets stuck again). Last April I have replaced the HD, so it's now just under 6 months old. And, of course, since the crash occurred when I was abroad and had backed up just before I left, I have lost only a few days' work. Still, and I know this will make me hugely unpopular here, with my 5 previous laptops running on MS Windows I never had a problem. Which does not mean I loved the OS, or I would not have switched to Mac.
    Anyway, and this is the main reason for this message, thank you very much again for your speedy intervention.
    Claudia

  • Moving iPhoto to external drive; have formatted external disk to Mac OS Extended (Journaled), moved the iPhoto library to external drive; when trying to change the library, the iPhoto file on new external is greyed out   can't be selected.What went wrong?

    Must have done something wrong..
    1.  formatted external disk to Mac OS Extended (Journaled) - required a partition, but that went fine.  Entire new external disk was included in the partition formatted to Mac OS Extneded (journaled).
    2.  moved iPhoto library to new external disk
    3.  Holding Option key down, opened iPhoto
    4.  Choose library feature appeared, however when new library function option appeared and "choose library" selected, the iPhoto folder appearing in the new external drive was greyed out and not able to be selected.  Therefore the default library remains the original iphoto library on the Mac. 
    I've moved the original iphoto library to the trash and then tried to start iPhoto.  A message comes up that the iPhoto is in the trash and needs to be pulled out before iPhoto can start (clearly the new iphoto library on the external drive is not being seen.
    Can anyone suggest where I went awry?  Thanks!

    Try trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder.
    (On 10.7 or later: Hold the option (or alt) key while clicking on the Go menu in Finder to access the User Library)
    (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    What's the plist file?
    For new users: Every application on your Mac has an accompanying plist file. It records certain User choices. For instance, in your favourite Word Processor it remembers your choice of Default Font, on your Web Browser is remembers things like your choice of Home Page. It even recalls what windows you had open last if your app allows you to pick up from where you left off last. The iPhoto plist file remembers things like the location of the Library, your choice of background colour, whether you are running a Referenced or Managed Library, what preferences you have for autosplitting events and so on. Trashing the plist file forces the app to generate a new one on the next launch, and this restores things to the Factory Defaults. Hence, if you've changed any of these things you'll need to reset them. If you haven't, then no bother. Trashing the plist file is Mac troubleshooting 101.
    Then try select it again.

Maybe you are looking for