Trying to move a graphics object using buttons.

Hello, im fairly new to GUI's. Anyway I have 1 class which makes my main JFrame, then I have another 2 classes, one to draw a lil square graphics component (which iwanna move around) which is placed in the center of my main frame and then another class to draw a Buttonpanel with my buttons on which is placed at the bottom of my main frame.
I have then made an event handling class which implements ActionListner, I am confused at how I can get the graphics object moving, and where I need to place the updateGUI() method which the actionPerformed method calls from inside the event handling class.
I am aware you can repaint() graphics and assume this would be used, does anyone have a good example of something simular being done or could post any help or code to aid me, thanks!

Yeah.. here's an example of custom painting on a JPanel with a box. I used a mouse as it was easier for me to setup than a nice button panel on the side.
Anyways... it should make it pretty clear how to get everything setup, just add a button panel on the side. and use it to move the box instead of the mouse.
-Js
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.event.MouseInputAdapter;
public class MoveBoxAroundExample extends JFrame
     private final static int SQUARE_EDGE_LENGTH = 40;
     private JPanel panel;
     private int xPos;
     private int yPos;
     public MoveBoxAroundExample()
          this.setSize(500,500);
          this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
          this.setContentPane(getPanel());
          xPos = 250;
          yPos = 250;
          this.setVisible(true);     
     private JPanel getPanel()
          if(panel == null)
               panel = new JPanel()
                    public void paintComponent(Graphics g)
                         super.paintComponent(g);
                         g.setColor(Color.RED);
                         g.fillRect(xPos-(SQUARE_EDGE_LENGTH/2), yPos-(SQUARE_EDGE_LENGTH/2), SQUARE_EDGE_LENGTH, SQUARE_EDGE_LENGTH);
               MouseInputAdapter mia = new MouseInputAdapter()
                    public void mousePressed(MouseEvent e)
                        xPos = e.getX();
                        yPos = e.getY();
                        panel.repaint();
                    public void mouseDragged(MouseEvent e)
                        xPos = e.getX();
                        yPos = e.getY();
                        panel.repaint();
               panel.addMouseListener(mia);
               panel.addMouseMotionListener(mia);
          return panel;
     public static void main(String args[])
          new MoveBoxAroundExample();
}

Similar Messages

  • How to change font/ font color etc in a graphic object using JCombobox?

    Hello
    My program im writing recently is a small tiny application which can change fonts, font sizes, font colors and background color of the graphics object containing some strings. Im planning to use Jcomboboxes for all those 4 ideas in implementing those functions. Somehow it doesnt work! Any help would be grateful.
    So currently what ive done so far is that: Im using two classes to implement the whole program. One class is the main class which contains the GUI with its components (Jcomboboxes etc..) and the other class is a class extending JPanel which does all the drawing. Therefore it contains a graphics object in that class which draws the string. However what i want it to do is using jcombobox which should contain alit of all fonts available/ font sizes/ colors etc. When i scroll through the lists and click the one item i want - the graphics object properties (font sizes/ color etc) should change as a result.
    What ive gt so far is implemented the jcomboboxes in place. Problem is i cant get the font to change once selecting an item form it.
    Another problem is that to set the color of font - i need to use it with a graphics object in the paintcomponent method. In this case i dnt want to create several diff paint.. method with different property settings (font/ size/ color)
    Below is my code; perhaps you'll understand more looking at code.
    public class main...
    Color[] Colors = {Color.BLUE, Color.RED, Color.GREEN};
            ColorList = new JComboBox(Colors);
    ColorList.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ev) {
                     JComboBox cb = (JComboBox)ev.getSource();
                    Color colorType = (Color)cb.getSelectedItem();
                    drawingBoard.setBackground(colorType);
              });;1) providing the GUI is correctly implemented with components
    2) Combobox stores the colors in an array
    3) ActionListener should do following job: (but cant get it right - that is where my problem is)
    - once selected the item (color/ font size etc... as i would have similar methods for each) i want, it should pass the item into the drawingboard class (JPanel) and then this class should do the job.
    public class DrawingBoard extends JPanel {
           private String message;
           public DrawingBoard() {
                  setBackground(Color.white);
                  Font font = new Font("Serif", Font.PLAIN, fontSize);
                  setFont(font);
                  message = "";
           public void setMessage(String m) {
                message = m;
                repaint();
           public void paintComponent(Graphics g) {
                  super.paintComponent(g);
                  //setBackground(Color.RED);
                  Graphics2D g2 = (Graphics2D) g;
                  g2.setRenderingHint             
                  g2.drawString(message, 50, 50);
           public void settingFont(String font) {
                //not sure how to implement this?                          //Jcombobox should pass an item to this
                                   //it should match against all known fonts in system then set that font to the graphics
          private void settingFontSize(Graphics g, int f) {
                         //same probelm with above..              
          public void setBackgroundColor(Color c) {
               setBackground(c);
               repaint(); // still not sure if this done corretly.
          public void setFontColor(Color c) {
                    //not sure how to do this part aswell.
                   //i know a method " g.setColor(c)" exist but i need to use a graphics object - and to do that i need to pass it in (then it will cause some confusion in the main class (previous code)
           My problems have been highlighted in the comments of code above.
    Any help will be much appreciated thanks!!!

    It is the completely correct code
    I hope that's what you need
    Just put DrawingBoard into JFrame and run
    Good luck!
    public class DrawingBoard extends JPanel implements ActionListener{
         private String message = "message";
         private Font font = new Font("Serif", Font.PLAIN, 10);
         private Color color = Color.RED;
         private Color bg = Color.WHITE;
         private int size = 10;
         public DrawingBoard(){
              JComboBox cbFont = new JComboBox(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
              cbFont.setActionCommand("font");
              JComboBox cbSize = new JComboBox(new Integer[]{new Integer(14), new Integer(13)});
              cbSize.setActionCommand("size");
              JComboBox cbColor = new JComboBox(new Color[]{Color.BLUE, Color.RED, Color.GREEN});
              cbColor.setActionCommand("color");
              JComboBox cbBG = new JComboBox(new Color[]{Color.BLUE, Color.RED, Color.GREEN});
              cbBG.setActionCommand("bg");
              add(cbFont);
              cbFont.addActionListener(this);
              add(cbSize);
              cbSize.addActionListener(this);
              add(cbColor);
              cbColor.addActionListener(this);
              add(cbBG);
              cbBG.addActionListener(this);
         public void setMessage(String m){
              message = m;
              repaint();
         protected void paintComponent(Graphics g){
              super.paintComponent(g);
              Graphics2D g2 = (Graphics2D)g;
              g2.setColor(bg);//set background color
              g2.fillRect(0,0, getWidth(), getHeight());          
              g2.setColor(color);//set text color
              FontRenderContext frc = g2.getFontRenderContext();
              TextLayout tl = new TextLayout(message,font,frc);//set font and message
              AffineTransform at = new AffineTransform();
              at.setToTranslation(getWidth()/2-tl.getBounds().getWidth()/2,
                        getWidth()/2 + tl.getBounds().getHeight()/2);//set text at center of panel
              g2.fill(tl.getOutline(at));
         public void actionPerformed(ActionEvent e){
              JComboBox cb = (JComboBox)e.getSource();
              if (e.getActionCommand().equals("font")){
                   font = new Font(cb.getSelectedItem().toString(), Font.PLAIN, size);
              }else if (e.getActionCommand().equals("size")){
                   size = ((Integer)cb.getSelectedItem()).intValue();
              }else if (e.getActionCommand().equals("color")){
                   color = (Color)cb.getSelectedItem();
              }else if (e.getActionCommand().equals("bg")){
                   bg = (Color)cb.getSelectedItem();
              repaint();
    }

  • Trying to create images to be used in my game

    Here's my situation. I have 3 main parts of the game.
    0 - in play
    1 - level up
    2 - buy screen
    each one has its own basic images/text that don't change. I want to create Images with all that background stuff already on it to improve the efficiency of the drawing. So here's what I tried:
    private Image          back, shipImage, ship2Image;
    private Graphics     backG;
    private Graphics2D     g2d;
    private Image[]          gameStateBackGround = new Image[3];
    private Graphics2D[]     gameStateGraphics2D = new Graphics2D[3];
    //In init.  I know these graphics objects work because this is what I
    //started with but now I'm wanting to improve
    back = createImage(mapWidth,mapHeight);
    backG = back.getGraphics();
    g2d = (Graphics2D) backG;
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    shipImage = Toolkit.getDefaultToolkit().getImage(getClass().getResource("ship.png")).getScaledInstance(20, 30, Image.SCALE_SMOOTH);
    ship2Image = Toolkit.getDefaultToolkit().getImage(getClass().getResource("ship2.png")).getScaledInstance(55, 35, Image.SCALE_SMOOTH);
    //In a method called in init() to create the Images I desribed
    gameStateBackGround[in_play] = createImage(mapWidth,mapHeight);
    drawStarField(gameStateBackGround[in_play].getGraphics());
    gameStateGraphics2D[in_play] = (Graphics2D) gameStateBackGround[in_play].getGraphics();
    starBase.draw(gameStateGraphics2D[in_play]);
    //In my draw method
    gameStateBackGround[in_play] = createImage(mapWidth,mapHeight);
    drawStarField(gameStateBackGround[in_play].getGraphics());
    gameStateGraphics2D[in_play] = (Graphics2D) gameStateBackGround[in_play].getGraphics();
    starBase.draw(gameStateGraphics2D[in_play]);now before I just had that main stuff drawing to the graphics objects used for the whole applet, and it worked fine. What I want is to pre-draw them, and just slap that whole single image of the constant stuff to my area of gameStateBackGround[]. Am I off to the right start?
    Now my drawStarField method asks for a Graphics object, and that draws, and that actually shows. Now for the stuff that's using Graphics2D objects, that is NOT showing. So I think where my main problem is is in creating the Graphics2D objects correctly. This whole concept I'm using for creating objects may be horrid, but hey, that's where you guys come in :) Tell me where I've screwed up hehe. Thanks for the help!          

    oops I screwed up. After:
    //In my draw method
    [/code
    comesbackG.drawImage(gameStateBackGround[gameState], 0, 0, this);

  • Read graphic Object properties 'scaling'

    Hi all,
    I am trying to read 'scaling' graphic Object properties values using in below code.  In case graphic having 60% that time also I am getting only 100%. So can I get some help? Thank you very much.
    function CheckScaing(doc)
       graphicObj = doc.FirstGraphicInDoc;
    while(graphicObj.ObjectValid())
            graphicObj = graphicObj.NextGraphicInDoc;
                  if(graphicObj.type == Constants.FO_Inset)
                      name = graphicObj.InsetFile;
                      var insetDpis=graphicObj.InsetDpi
                      alert(insetDpis)

    Hello,
    There is no available built-in concerning the graphic objects displayed on the canvas. All you can do use another stacked canvas to show/hide the graphic objects located on it.
    Francois

  • Can't warp pasted AI vector Smart Object using Free Transform in PS CS6

    Hi
    I pasted a vector object into PS CS6 (13.0.1 x32) today directly from Illustrator CS6 (16.0.1 x32), and selected "Paste as Smart Object" (Windows XP Pro SP3).
    I then tried to warp the pasted object using the Free Transform tool by dragging one of the corner handles with CTRL held down (Windows).
    This usually warps\distorts the object, but instead, this launched a skew operation.
    If I paste as Shape Layer or as Pixels then apply Free Transform, <Ctrl + corner handle drag> performs a warp\distort operation.
    Also, if I rasterise the pasted AI object, and then convert to a Smart Object I can warp\distort.
    Is it not possible to paste an Illustrator vector in as a Smart Object, and then warp\distort it directly using this technique?
    Thanks for your help.
    Richard

    Your right in that on a pasted vector smart one can't warp, distort or perform perspective transforms.
    One workaround would be to right click on the vector smart object layer in the layers panel and
    choose convert to smart object.
    It depends on what your object is, but you'd probably get better quality from a pasted shape or path, but then you won't be able to open the object
    back in illustrator from photoshop.

  • Can't able to create callable object using UI pattern in CAF

    Hello
    I made one interface using object Selection UI pattern for one of my entity services. Now i am trying to make a callable object using this and i also have been successfully created it. But when I test this callable object, I got these error messages.
    1. Could not load execution container: Cannot access object class loader for deployable object sap.com/cafcoregpuivisibleco~container.
    2. Could not load execution container: ComponentUsage(container): Active component must exist when getting interface controller. (Hint: Have you forgotten to create it with createComponent()? Should the lifecycle control of the component usage be "createOnDemand"?
    Please tell me the problem

    Hi Saurabh,
    It seems you found a bug. The problem is that runtime library reference to sap.com/cafruntimeuicouplingapilib library from sap.com/cafcoregpuivisibleco~container dc is misspelled.
    So, I don't know whether or not according CSN is already created but I can propose you a solution.
    1. Unpack the cafcoregpuivisibleco~container archive from CAFKM0X_0.sca sca.
    2. Unpack sap.comcafcoregpuivisiblecocontainer.wda archive.
    3. Open the PORTAL-INF\portalapp.xml file and change the following entry of library reference:
    <property name="LibrariesReference" value="sap.com/cafruntimeuicopulingapilib" />
    to
    <property name="LibrariesReference"    value="sap.com/cafruntimeuicouplingapilib"/>And pack
    it pack it again in correct order(for ex.:
    jar.exe -Mcvf sap.comcafcoregpuivisiblecocontainer.wda .
    jar.exe -Mcvf sap.comcafcoregpuivisiblecocontainer.sda .
    And finally deploy it to your server instance and enjoy.
    Best regards,
    Aliaksei

  • Using a vector graphic for a button

    Adobe Photoshop, Illustrator, and Encore CS5, everything is patched, Windows 7 64-bit
    I have been reading various posts, and either not seeing or not understanding something about using a vector graphic as a button on a menu.
    I drew a one-color shape in Illustrator, saved it as EPS and PNG and used it in a menu designed in Photoshop. When I preview it in Encore or burn a DVD, the graphic looks awful. And I'd like to use highlighting with it so it changes color when selected but that is another problem....
    To start the menu, I used the Photoshop preset NTSC DV Widescreen which has a pixel aspect ratio of 1.21. Then I added background graphics and so on. Each button is contained in a layer group named (+)PlayAll, etc. In each layer group is a text layer that doesn't have a prefix (e.g., Play All) and another layer with the vector or PNG named (=1)kv, which is the name of the EPS or PNG file.
    The behavior is fine. The graphic moves to indicate which menu item is selected, the text is constant, never changes.
    In Photoshop, the graphic looks fine but when I preview it in Encore it looks crappy and pixelated. What do I do?

    Part of the problem is I have no idea what some of these terms mean ... "2-bit indexed", ... The first one might mean an object that has one color,
    It is not the same as one color, and yes, it probably means more than any of us intend.  See  Encore help regarding button subpictures, in particular the part regarding using Photoshop to create button subpictures.
    The latter includes "(Technically, the subpicture overlay is a two‑bit indexed image.)," but you don't need to understand the technical meaning (they don't explain it anyway).  You do need to understand the liimitations they explain there,  For example, under "solid colors only," they say "Elements on these layers must use solid colors and sharp edges. Use one solid color per layer. Do not use gradients, feathering, or anti-aliasing on the subpicture layers. Color gradations are not possible in subpictures."
    "sub-picture highlight" ... the second one is probably made up.
    Heh, heh.  Searching that in Encore help (which I often find lacking) finds the page on Button Subpictures.  I agree that some of the terms, whether they are from the DVD specs or Sonic's applications (on which Encore is based), can make it difficult to look things up.
    "vector layer".... I searched Photoshop help for "vector layer" and got nothing. There is such a thing as a vector mask on a layer but I have no clue what a vector layer is.
    You're correct - vector mask.  Within a button group, the vector mask will be part of a layer, so I think of it as the button group "vector mask" layer.  That's part of why I pointed to using a library menu and editing in photoshop so you could compare what you have to what a template looks like.
    Please suggest which Encore library menu I can try. I opened a couple and couldn't figure out how they worked.
    In the General set, pick the Sunset menu.  Edit in Photoshop.  Expand the "(+) play movie" layer.  The "button vector mask" (the dark area) is in the layer called "button."  Notice that it does not have a (=1) or other indicator that it is a highlight.  In other words, it will just sit there, in whatever color is defined, and will not be a highlight.  If you put it in a layer that has one of the highlight indicators (the =1, =2 etc), it will then be subject to the subpicture highlight limitations.
    You might try your graphic in such a non-subpicture layer, and compare its appearance to putting it in a subpicture layer.
    Jeff Bellune's book (he's a moderator here) is still very applicable.  While some things have change, the basics haven't.
    But, hey, Jeff.  Why haven't you updated your book yet?  Inquiring minds want to know!

  • Trying to use Buttons and keep getting an error code

    I am trying to use buttons and I keep getting the error code ReferenceError: Error #1074: Illegal write to read-only property graphics on flash.display.MovieClip.
    There is one button that doesnt appear when I view it live/in browser/ in flash professional
    I have created this button the SAME way, about 36 times, as the other buttons that work fine. What am I doing wrong?
    PLEASE HELP ASAP...

    The error appears to involve trying to assign a value to the graphics property of a MovieClip.  Do you have code that uses something.graphics =

  • Trying to figure out how to use a video's alpha channel to define its hitspace for a button

    Hello, I'm trying to figure out how to use a video's alpha channel to define its hitspace for a button. I would greatly appreciate anyone's help with this.

    Currently I'm doing an image sequence inside of a movie, and putting the movie in the button. I hope that's what you're asking. Not sure if I entirely understand your question. (Been a little while since I used the interactive side of Flash)
    Anyway if you have a specific process that you personally do that works I'd happily conform to your solution.

  • Using Lightroom 5.5 and Photoshop CC2014. Images no longer open in Photoshop when using "edit in" command. Photoshop opens but no image when trying to move between LR and PS. Any suggestions?

    Using Lightroom 5.5 and Photoshop CC2014. Images no longer open in Photoshop when using "edit in" command. Photoshop opens but no image when trying to move between LR and PS. Any suggestions?

    1. You have allowed Apple to auto-upgrade your Mac
    Turn off auto-update here:
    Menu > Apple > System Preferences > App Store
    2. The Icons on your dock are Aliases not real apps
    They point to where the apps really are which is:
    For Pages 5.2.2 in your Applications folder
    For Pages '09 in your Applications/iWork folder
    3. You are alternately opening documents randomly with either version of Pages
    Both Pages have the same file extension .pages and there is no certainty as to which version opens them when you double click on a file.
    right click on the file and choose which version you want to open it
    4. Pages '09 can not open Pages 5 files
    Pages 5 can not open Pages '08 files, and will convert and change Pages '09 and Word files.
    It will also auto save opened files into its own format.
    You can export these back to Pages '09 if you need to:
    Menu > File > Export > Pages '09
    5. Yes Pages 5.2.2 is a marked downgrade
    Pages 5.2.2 has a few improvements but has had over 110 features removed and is buggy.
    Sooner or later you will not be able to open a file or have it damaged in some way and it has a complex obscure file format largely incompatible with everything else, so you will not be able to rescue the contents of your file. If Pages or some third party server/eMail don't trash your file, eventually Apple will do it for you as it did when it released Pages 5 last September. I recommend using Pages '09 for the time being whilst you look for viable alternatives, some are here already and some are on the way.
    For further information about what has happened:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=0882463378700 abf43a0f2433506bbbc&mforum=iworktipsntrick
    Peter

  • How to move a selected row data from one grid to another grid using button click handler in flex4

    hi friends,
    i am doing flex4 mxml web application,
    i am struck in this concept please help some one.
    i am using two seperated forms and each form having one data grid.
    In first datagrid i am having 5 rows and one button(outside the data grid with lable MOVE). when i am click a row from the datagrid and click the MOVE button means that row should disable from the present datagrid and that row will go and visible in  the second datagrid.
    i dont want drag and drop method, i want this process only using button click handler.
    how to do this?
    any suggession or snippet code are welcome.
    Thanks,
    B.venkatesan.

    Hi,
    You can get an idea from foolowing code and also from the link which i am providing.
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    width="613" height="502" viewSourceURL="../files/DataGridExampleCinco.mxml">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.binding.utils.BindingUtils;
    [Bindable]
    private var allGames:ArrayCollection;
    [Bindable]
    private var selectedGames:ArrayCollection;
    private function initDGAllGames():void
    allGames = new ArrayCollection();
    allGames.addItem({name: "World of Warcraft",
    creator: "Blizzard", publisher: "Blizzard"});
    allGames.addItem({name: "Halo",
    creator: "Bungie", publisher: "Microsoft"});
    allGames.addItem({name: "Gears of War",
    creator: "Epic", publisher: "Microsoft"});
    allGames.addItem({name: "City of Heroes",
    creator: "Cryptic Studios", publisher: "NCSoft"});
    allGames.addItem({name: "Doom",
    creator: "id Software", publisher: "id Software"});
    protected function button1_clickHandler(event:MouseEvent):void
    BindingUtils.bindProperty(dgSelectedGames,"dataProvider" ,dgAllGames ,"selectedItems");
    ]]>
    </mx:Script>
    <mx:Label x="11" y="67" text="All our data"/>
    <mx:Label x="10" y="353" text="Selected Data"/>
    <mx:Form x="144" y="10" height="277">
    <mx:DataGrid id="dgAllGames" width="417" height="173"
    creationComplete="{initDGAllGames()}" dataProvider="{allGames}" editable="false">
    <mx:columns>
    <mx:DataGridColumn headerText="Game Name" dataField="name" width="115"/>
    <mx:DataGridColumn headerText="Creator" dataField="creator"/>
    <mx:DataGridColumn headerText="Publisher" dataField="publisher"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:FormItem label="Label">
    <mx:Button label="Move" click="button1_clickHandler(event)"/>
    </mx:FormItem>
    </mx:Form>
    <mx:Form x="120" y="333">
    <mx:DataGrid id="dgSelectedGames" width="417" height="110" >
    <mx:columns>
    <mx:DataGridColumn headerText="Game Name" dataField="name" width="115"/>
    <mx:DataGridColumn headerText="Creator" dataField="creator"/>
    <mx:DataGridColumn headerText="Publisher" dataField="publisher"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Form>
    </mx:Application>
    Link:
    http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/ae9bee8d-e2ac-43 c5-9b6d-c799d4abb2a3/
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • How to use a Graphics Object in a JSP?

    Hello, I do not know if this is a good or a silly question. Can anyone tell me if we can use a Graphics object in a JSP. For example to draw a line or other graphics, i am planning to use the JSP. Any help is much appreciated.
    Regards,
    Navin Pathuru.

    Hi Rob or Jennifer, could you pour some light here.
    I have not done a lot of research for this, but what i want to do is below the polygon i would like to display another image object like a chart... is it possible? If so how to do it? Any help is much appreciated.
    here is the code:
    <%
    // Create image
    int width=200, height=200;
    BufferedImage image = new BufferedImage(width,
    height, BufferedImage.TYPE_INT_RGB);
    // Get drawing context
    Graphics g = image.getGraphics();
    // Fill background
    g.setColor(Color.white);
    g.fillRect(0, 0, width, height);
    // Create random polygon
    Polygon poly = new Polygon();
    Random random = new Random();
    for (int i=0; i < 5; i++) {
    poly.addPoint(random.nextInt(width),
    random.nextInt(height));
    // Fill polygon
    g.setColor(Color.cyan);
    g.fillPolygon(poly);
    // Dispose context
    g.dispose();
    // Send back image
    ServletOutputStream sos = response.getOutputStream();
    JPEGImageEncoder encoder =
    JPEGCodec.createJPEGEncoder(sos);
    encoder.encode(image);
    %>
    Regards,
    Navin Pathuru

  • Trying to get a handle to an object using CVI_ActiveApp, but it opens a new CVI everytime it runs. Is there a way to get a handle to an object without it opening up a new CVI?

    I'm trying to get a handle to an object using CVI_ActiveApp. It works, but it opens a new CVI application when it is run using the command line. Is it possible to get a handle to an object without a new CVI application opening up?

    Hi,
    In the help documentation for the CVI_ActiveApp function, it states:
    "If the server application is already running, this function may or may not start another copy of the application. This is determined by the server application."
    http://zone.ni.com/reference/en-XX/help/370051P-01/cvi/usermanual/actxappactiveapp/
    I don't believe you have control over whether or not a second instance is started.
    Regards,
    Lindsey W. | Applications Engineer | National Instruments

  • Hey, I Iam trying to move my songs from my desktop computer to my laptop by useing home share and i have got homeshare working on my laptop but when i try to get it to work on my desktop it sayshome sharing could not be activated because an error occurred

    Hey,
       I am trying to move my songs from my desktop computer to my laptop useing homeshare and I got it to work on my desk top but when i try to get iot to work on my desktop it says Home shareing could not be activated because an error occurred (-3150) what should i do??

    awoodburn wrote:
    Is there a way to get these non-intunes store bought songs into my newly downloaded itunes library?
    check out this post by Zevoneer.

  • HT1329 I am trying to move music from my ipod onto my mac. When I locate the ipod under devices on my mac there is no music ! even though I can see it and play it when I use the ipod. So how can I transfer it ?

    I am trying to move music from my ipod onto my mac. When I locate the ipod under devices on my mac there is no music ! even though I can see it and play it when I use the ipod. So how can I transfer it ?

    brianmartinwoolf wrote:
    I am trying to move music from my ipod onto my mac. ...
    Was this Music purchased in iTunes... If so... see here...
    Transfer Purchases
    File > Devices > Transfer Purchases
    More Info Here  >  http://support.apple.com/kb/HT1848

Maybe you are looking for

  • Build a project report with detail information

    Hi, I want to build a project report in BW and am not sure if my idea is feasable.... The report should consist of two parts: the head part consists detailed information about a project like ID, status, owner, start date. The body part contains infor

  • ITunes 7.02 issues

    Here are my biggest gripes with iTunes 7 . i buy alot of iPods. in fact whenever a new one comes out, i pre-order it and pretty much get it the same day it comes out. And so I re-load my music onto the new iPod and everytime, no wait, EVERYTIME, at s

  • X220 screen problem

    Hi, the screen is behaving as if the computer thinks it has a larger resolution than it actually does. ie. the the text does not begin right up against the left hand side of the screen, and runs off the right hand side. NOTE this happens in the BIOS

  • Can't import Adobe Illustrator CS4 .ai files

    I recently upgraded to Adobe Illustrator CS4. When I attempt to paste an .ai file into iWeb I see only a black rectangle. This was not the case with CS3 AI. It seems that I must now first convert the AI CS4 file into a .pdf or .eps before importing t

  • Unable to play videos on the BBC web site.

    Running an iMac (Mac OS X 10.9.1) with Safari (7.0.1) and Flash Player 11.9.900.170 I get the message "This content doesn't seem to be working. Please try again later" when trying to run any videos (including those in iPlayer) on the www.bbc.co.uk we