Looking for istructions/examples for using winsock in Labview

I'm looking for instructions or examples of using winsock in Labview. Looking in the NI examples I found an example using winsock UDP with Labwindows but nothing for Labview. Is the same function named different in Labview?

Thanks for the links. Unfortunately, I am specifically looking for the ways to use WinSock (I want to collect data from a number of remote locations and the WinSock would provide me with an effective way to
a) control the telephone number to be dialed (different for different remote stations)
b) provide me with TCP/IP, so I could use the full power of LabVIEW seeing a remote computer as an IP address (and being able to use shared variables, web server, data socket etc. instead of me having to program all that myself)
The other acceptable way would be to utilise a driver for a virtual network card (so I can programmically access it as TCP/IP on one side, and as a flow of bytes on the other, "virtual network cable", side). Any suggestions in this direction? By the way, it would be the best if the National Instuments would do such a virtualisation themselves. It would allow to utilise a number of solutions painlessly.

Similar Messages

  • Looking for an example for using CreateViewObject()

    ADF 11g
    Hello
    In order to have a temporary vo for some internal processing
    I'm looking for an example for using CreateViewObject()
    If I understand things correctly it is used as follows :
    ViewObject vo = am.createViewObject("MyVO", "package1.DeptView");
    vo.executeQuery()
    // do my processing here
    vo.remove()Is this correct ?
    Regards
    Paul

    Hi Paul,
    Yes it is correct, you can find the sample code in [this post|http://radio.weblogs.com/0118231/stories/2003/01/17/usingViewObjectsInEntityObjectsForAnEfficientExistenceCheck.html] by steve muench(Search with createViewObject for quick referencing)
    Sireesha

  • Looking for an example of using Automator action in an Applescript

    Does anyone have an example of how to use an Automator action in an Applescript? I want to use the Automator action that creates a note for an iPod and then sends it to the iPod inside an Applescript (I want to be able to loop through all of the text files in a folder). Any examples would be helpful. Thanks.

    Hi Mike
    You could save the workflow as an application and then write a simple script that tells the application to launch multiple times.
    But you'll find it many times faster to do it the other way round, and run a looping AppleScript from a single Automator action.
    (Your iPod must be set up in disk mode.)
    set ipod_name to "Name of your iPod goes here" -- edit this line and put the name of your pod in inverted commas
    tell application "Finder" to set ipod_ready to exists disk ipod_name
    if ipod_ready then
    set text_folder to (choose folder with prompt "Choose the folder containing notes for your iPod.")
    set file_names to list folder text_folder without invisibles
    repeat with file_name in file_names
    set file_path to text_folder & file_name as string
    if file type of (info for file_path) is "TEXT" then
    tell application "Finder"
    move file file_path to folder "Notes" of disk ipod_name
    end tell
    end if
    else -- ipod not mounted
    display dialog "Mount your iPod first!" buttons {"OK"} default button 1 with icon caution giving up after 5
    end if
    Copy and paste this into a Run AppleScript action, edit to supply the name of your own ipod, and see how it goes.
    Hope this helps,
    H

  • Looking for an example of using a Message Driven Bean.  Anyone?

    I see that iAS 6.5 does NOT come with the newest PetStore which includes a Message Bean. I have build and deployed a MDB and I see it in the iAS admin tool but it never is automatically started (like the manual says it should)and therefore is never listening for a JMS message. The same bean (different deployment descriptor of course for iAS-ejb-jar etc) works on JBoss just fine.

    Hi Mike
    You could save the workflow as an application and then write a simple script that tells the application to launch multiple times.
    But you'll find it many times faster to do it the other way round, and run a looping AppleScript from a single Automator action.
    (Your iPod must be set up in disk mode.)
    set ipod_name to "Name of your iPod goes here" -- edit this line and put the name of your pod in inverted commas
    tell application "Finder" to set ipod_ready to exists disk ipod_name
    if ipod_ready then
    set text_folder to (choose folder with prompt "Choose the folder containing notes for your iPod.")
    set file_names to list folder text_folder without invisibles
    repeat with file_name in file_names
    set file_path to text_folder & file_name as string
    if file type of (info for file_path) is "TEXT" then
    tell application "Finder"
    move file file_path to folder "Notes" of disk ipod_name
    end tell
    end if
    else -- ipod not mounted
    display dialog "Mount your iPod first!" buttons {"OK"} default button 1 with icon caution giving up after 5
    end if
    Copy and paste this into a Run AppleScript action, edit to supply the name of your own ipod, and see how it goes.
    Hope this helps,
    H

  • Looking for config example for qos marking on IOS edge router for UCCE

                       I was going through the UCCE SRND for QOS config, and found the following sample, wondering if someone can provide a tested config example to configur the QOS on edge router for UCCE.
    access-list 100 permit tcp host Public_High_IP any
    access-list 100 permit tcp any host Public_High_IP
    access-list 101 permit tcp host Public_NonHigh_IP any
    access-list 101 permit tcp any host Public_NonHigh_IPSecond, classify the traffic using a class map:class-map match-all ICM_Public_High
    match access-group 100
    class-map match-all ICM_Public_Low
    match access-group 101
    policy-map ICM_Public_Marking
    class ICM_Public_High
    set ip dscp af31
    class ICM_Public_Low
    set ip dscp af11Finally, apply the marking policy to the incoming interface:interface mod/port
    service-policy input ICM_Public_Marking

    Disclaimer
    The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
    Liability Disclaimer
    In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
    Posting
    If you're going to use only two queues, and if you want to guarantee the one queue 35% of your egress bandwidth, you need to assign your two queues the ratio of 65:35; you'll need to adjust the four queue percentages to provide those two queues the same ratio.  Ideally you'll want something like share 0 65 35 0, but if you cannot assign zero, something like 40 13 7 40, 20 39 21 20, 10 52 28 10 should do.

  • My solution for boiler example -for CLD

    Hi all,
    I am currently preapring for the CLD and so attempting the sample examples. I have given a try for the boiler example.
    I request all the champs here to provide me the comments on the coding. As coding was done in working time documentation is not done in very good way. But i would like to know the overall comments on it.
    Thanks in advance!!!
    Attachments:
    Boiler.zip ‏70 KB

    I hate to be the bearer of bad news but I doubt this would pass. There are lots of things that need improvement. Below is a quick list of things you need to look at.
    Document all controls, indicators and VIs.
    DO NOT leave the front panels and block diagrams maximized. You should try to fit things on a single screen. Also, the main front panel must look like the requirements including the basic size.
    Keep your wires straight. Avoid unnecessary bends. Something that is definitely not done in your code.
    Label wires that pass through your state machine. This adds to the documentation and readability of the code.
    Don't place items on top of each other.
    Make better use of subVIs.
    Document your code better. Referring to block diagram comments.
    You have an issue with your state machine. You effectively queue things up in an array but it is possible that you will not execute all the states.
    I didn't try running it so I can't comment on the functionality. As soon as I opened it I knew you had more to concentrate and practice than the basic functionality at this point.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • I need simple example for alv grid

    hi
    i need code for simple example for alv grid.
    thanks.

    hi bharat,
                  this is report with most of the functionality.
    report zus_alv_demo_grid .
    tables:     ekko.
    type-pools: slis.
    types: begin of t_ekko,
    ebeln type ekpo-ebeln,
    ebelp type ekpo-ebelp,
    statu type ekpo-statu,
    aedat type ekpo-aedat,
    matnr type ekpo-matnr,
    menge type ekpo-menge,
    meins type ekpo-meins,
    netpr type ekpo-netpr,
    peinh type ekpo-peinh,
    line_color(4) type c, "Used to store row color
    end of t_ekko.
    data: it_ekko type standard table of t_ekko initial size 0,
           wa_ekko type t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid.
    Data declaration for EVENT and PRINT PARAMETER.
    data: gt_events type slis_t_event,
           gd_prntparams type slis_print_alv.
    data declaration for sorting.
    data : it_sortcat   type slis_sortinfo_alv occurs 1,
           wa_sort like line of it_sortcat.
    data :  i_list_comments type slis_t_listheader.
    start-of-selection.
      perform data_retrieval.
    perform user_command.
      perform build_fieldcatalog.
      perform build_layout.
      perform build_events.
      perform build_print_params.
      perform build_sortcat.
      perform display_alv_report.
    end-of-selection.
    *TOP-OF-PAGE.
    PERFORM top-of-page.
    end-of-page.
    *&      Form  build_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    form build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      fieldcatalog-do_sum = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " build_fieldcatalog
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    Set layout field for row attributes(i.e. color)
      gd_layout-info_fieldname =      'LINE_COLOR'.
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for
    *when double
                                            "click(press f2)*
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " build_layout
    *&      Form  data_retrieval
          text
    -->  p1        text
    <--  p2        text
    form data_retrieval.
      data: ld_color(1) type c.
      select ebeln ebelp statu aedat matnr menge meins netpr
    peinh from ekpo  into table it_ekko.
    *Populate field with color attributes
      loop at it_ekko into wa_ekko.
    Populate color variable with colour properties
    Char 1 = C (This is a color property)
    Char 2 = 3 (Color codes: 1 - 7)
    Char 3 = Intensified on/off ( 1 or 0 )
    Char 4 = Inverse display on/off ( 1 or 0 )
              i.e. wa_ekko-line_color = 'C410'
        ld_color = ld_color + 1.
    Only 7 colours so need to reset color value
        if ld_color = 8.
          ld_color = 1.
        endif.
        concatenate 'C' ld_color '10' into wa_ekko-line_color.
    wa_ekko-line_color = 'C410'.
        modify it_ekko from wa_ekko.
      endloop.
    endform.                    " data_retrieval
    *&      Form  display_alv_report
          text
    -->  p1        text
    <--  p2        text
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = gd_repid
                is_layout                = gd_layout
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                i_callback_user_command  = 'USER_COMMAND'
                i_callback_pf_status_set = 'SET_PF_STATUS'
                it_event                 = gt_events
                is_print                 = gd_prntparams
                it_fieldcat              = fieldcatalog[]
                it_sort                 = it_sortcat
                i_save                   = 'X'
           tables
                t_outtab                 = it_ekko
           exceptions
                program_error            = 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.
    endform.              " DISPLAY_ALV_REPORT
    *&      Form  user_command
          text
    -->  p1        text
    <--  p2        text
    *&      Form  top-of-page
          text
    -->  p1        text
    <--  p2        text
    form top-of-page.
    *ALV Header declarations
      data: t_header type slis_t_listheader,
            wa_header type slis_listheader,
            t_line like wa_header-info,
            ld_lines type i,
            ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      concatenate  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
       sy-datum(4) into wa_header-info."todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
         into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
           it_list_commentary = t_header
           i_logo             = 'GANESH_LOGO'.
    endform.                    " top-of-page
          FORM user_command                                             *
    -->  R_UCOMM                                                       *
    -->  RS_SELFIELD                                                   *
    form user_command using r_ucomm like sy-ucomm
    rs_selfield type slis_selfield.
      case r_ucomm.
        when '&IC1'.
          if rs_selfield-fieldname = 'EBELN'.
            read table it_ekko into wa_ekko index rs_selfield-tabindex.
            set parameter id 'BES' field wa_ekko-ebeln.
            call transaction 'ME23N' and skip first screen.
          endif.
        when 'ULHAS'.
          if rs_selfield-fieldname = 'EBELN'.
            read table it_ekko into wa_ekko index rs_selfield-tabindex.
            set parameter id 'BES' field wa_ekko-ebeln.
            call transaction 'ME23N' and skip first screen.
          endif.
      endcase.
    endform.
          FORM set_pf_status                                            *
    -->  RT_EXTAB                                                      *
    form set_pf_status using rt_extab type slis_t_extab.
      set pf-status 'ZNEWSTATUS'.
    endform.
    *&      Form  build_events
          text
    -->  p1        text
    <--  p2        text
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
       exporting
         i_list_type           = 0
       importing
         et_events             = gt_events[]
    EXCEPTIONS
      LIST_TYPE_WRONG       = 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.
      read table gt_events with key name =  slis_ev_end_of_page
                  into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
      read table gt_events with key name =  slis_ev_end_of_list
                  into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " build_events
    *&      Form  build_print_params
          text
    -->  p1        text
    <--  p2        text
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " build_print_params
          FORM END_OF_PAGE                                              *
    form end_of_page.
      data: listwidth type i,
      ld_pagepos(10) type c,
      ld_page(10)    type c.
      write: sy-uline(50).
      skip.  write:/40 'Page:', sy-pagno .
    endform.
          FORM END_OF_LIST                                              *
    form end_of_list.
      data: listwidth type i,
      ld_pagepos(10) type c,
      ld_page(10)    type c.
      skip.  write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  build_sortcat
          text
    -->  p1        text
    <--  p2        text
    form build_sortcat.
    wa_sort-spos      = 1.
    wa_sort-fieldname = 'EBELN'.
    append wa_sort to it_sortcat.
    wa_sort-spos      = 2.
    wa_sort-fieldname = 'EBELP'.
    append wa_sort to it_sortcat.
    endform.                    " build_sortcat
    Rewards if helpfull
    regards
    vijay dwivedi

  • Any example for Timed ShellScript Discovery with PowerShell Discovery Probe?

    Hi all,
    Kris Bash provided a unix authoring library with many examples for dynamic discoveries for Unix/Linux (Unix/Linux Authoring
    Library). What I am missing here is a timed shell script discovery, using a powershell discovery probe for creating discovery data. There is only a PropertyBag Discovery available.
    Maybe one of you has already implemented such a discovery and can provide this as an example? I tried some things but so far it is not working.
    The idea behind this is to execute a shell script on a linux host that returns several lines. The output should then be parsed by a powershell script that - depending on the output - creates different class instances. Any ideas?
    Regards,
    Holger

    Holger,
    See the blog post here (http://operatingquadrant.com/2011/03/24/operations-manager-%e2%80%93-extending-unixlinux-monitoring-with-mp-authoring-%e2%80%93-part-iii/)
    for an example of using the PowerShellDiscoveryProbe.  It doesn't matter whether this follows a Shell Command or a Shell Script probe, as in both cases you are passing the StdOut output as a parameter to the PowerShell script.  You would parse StdOut
    just as you do in the PropertyBag examples, but use the MOMApi calls to create and return the class instances and properties.
    I hope this helps,
    Kris
    www.operatingquadrant.com

  • Looking for an example from app gallery that uses WAAD for identity

    I'm looking for an example from the app gallery (http://azure.microsoft.com/en-us/gallery/active-directory/) that uses WAAD for identity. I need one the show our business what the process would look like for an organization signing up for a SaaS offering
    via the App Gallery. I know all the Microsoft applications use WAAD but I was hoping to find a third-party example.  What I mean is an app where all tenant and user identity is done using WAAD as opposed to federated identity.

    I doubt that what you are looking for exists yet.
    Cheers,
    Markus
    Markus Vilcinskas, Knowledge Engineer, Microsoft Corporation

  • Looking for example to use Aerotech Solist CP motor in CVI

    Hi all,
      Is there any example to drive Aerotech's Soloist CP motor in CVI? I found a labview code for Soloist CP in the installation directory. I used that with labview before but now I am porting lal code to CVI, I have no idea how to make it work in CVI.

    RobertoBozzolo wrote:
    You need to study the documentation that comes with your device and the interfacing possibilities the device offers. If the driver comes with a DLL than you could try using DLL functions directly in CVI: this document offers some explanations on how to realize this part, in any case the DLL must come with some include file that declares functions and types to use. You can also search in the support site or in the forums for additional documents or examples.
    The LabVIEW driver itself could be an interface to the DLL, so if you have some familiarity with LV you could try looking at the underlyning code to see what's in it.
    Having said this, I have never used devices from that producers so I cannot be of much help in using them.
    Hi RobertoBozzolo,
      With your suggestion, I've compiled the vi to DLL. For testing, I write a code in c to call it and compile with gcc mingw32. It seems ok. But in the environment of labwindows/CVI, I don't have other compiler other than CVI. So following this post http://digital.ni.com/public.nsf/allkb/70995EC2CA1B523386256DD4004F3DE6?OpenDocument, I have the DLL and the related header files copied to the same folder as the CVI program in. I should state that the DLL from Vi was compiled in other computer have labview 7.1 installed, it is running 32bits windows xp. But in the development environment (where I compiled the CVI), I am runing 2012 version in 64bit operating system. I don't know will that cause any conflict. But as directed in that page, I copy all headers in cintools from the LV7.1 computer, but when I compile it, it is said that " "fundtypes.h"(116,20)   Redeclaration of 'int64'." I have no idea how to fix this issue then
    Well, anyway, I comment out the definition of int64 in fundtypes.h and it finally compiled. However, since the DLL was compiled from LV7.1, when I run the compiled application with functions calling from the DLL, I got an error message that labview 7.1 runtimes required. Well, it is not a good idea to ask the client to install LV7.1 (runtime) just for running our application. So is that possible to compile the DLL and linking everything into the DLL so it doesn't require runtime 7.1? or any other suggestion?

  • I am looking for an example of how to use the Rendezvous synchronization object.

    I can't seem to find an example that uses the TestStand Synchronization Step Types. I am specifically interested in the Rendezvous type. I am have programmed quite a few VC++ applications that use semaphores, so I am familiar with the overall idea of sync objects.
    Thanks in advance.
    ~tony

    Here is a pretty good example that illustrates the benefits of multithreading over single threaded tests, and it utilizes a rendezvous to synchronize its multiple threads (see attachment to this post).
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask
    Attachments:
    Rendezvous_Demo.zip ‏81 KB

  • Example VIs for winsock with LabVIEW 7.0

    Are there any example VIs for TCP communications with winsock using LabVIEW 7.0?

    I would like to join the request - I would like to know how to use WinSock from within LabVIEW to use a modem to dial a number and connect to another PC with a modem. An extra complicaiton is the fact that I need to be able to vary the number (to access numerous data acquisition stations).
    Message Edited by alysko on 03-08-2006 03:57 PM
    Message Edited by alysko on 03-08-2006 03:58 PM

  • Anyone have a example for useing volitile image in exclusive mode with

    i need a example of how to use a volitile image in exclusive mode with active rendering .
    anyone know of one or even partial code of how to do it ive been racking my brain trying to figure out how to do it.
    or even a example of fullscreen that i can use to draw to the screen in exclusive fullscreen mode.
    and im not talking about the sun tutorial no one can even answer my question about it when i asked in the java forum

    by the way, here's a commented version of the example I gave earlier in case the puzzle pieces are upside down for you...
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    /* Goes into FullScreen with 640x480 16 bit
    * Not all proper checks are made (like getting available DisplayModes),
    * But you can always look at the doc for the rest of the checks. Besides,
    * What computer doesn't have 640x480...?
    public class Example extends Frame implements Runnable, KeyListener {
         VolatileImage v;
         int w,h,x,size; // x and size are for the moving ball
         boolean done; // when this is true, the program exits
         public Example() {
              /* Sets up the frame to be used for fullscreen */
              super(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration());
              GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
              /* the below 2 methods aren't required
              * but using them results in best performance.*/
              setUndecorated(true);
              setIgnoreRepaint(true);
              /* A few mandatorial checks */
              if (device.isFullScreenSupported()) {
                   device.setFullScreenWindow(this);
              if (device.isDisplayChangeSupported()) {
                   device.setDisplayMode(new DisplayMode(640,480,16,0));
              /* our frame must be showing before we
              * we create our BufferStrategy or image,
              * in this case a VolatileImage.
              * Showing our frame also switches to
              * fullscreen mode.
              show();
              w = getSize().width;
              h = getSize().height;
              x = 0;
              size = 30;
              v = createVolatileImage(w,h); // creates volatile image (duh)
              done = false; // program exits when true
              addKeyListener(this); // used for exiting
              new Thread(this).start(); // starts the thread
         public void run() {
              while (!done) {
                   x += 2; // increase ball location
                   if (x >= w-size) x = 0; // back to left if all the way right
                   /* You could also use repaint() here,
                   * but you won't get a screen update
                   * until the system decides it's time.
                   * calling paint(getGraphics()) is much faster
                   paint(getGraphics());
                   /* Pausing of the thread... */
                   try {
                        Thread.sleep(1);
                   catch (InterruptedException e) {
                        done = true; // exit if there was some error
              System.exit(0); // this won't be called until done is true
         public void paint(Graphics g) {
              /* this attempts to get the graphics
              * from VolatileImage */
              Graphics gfx = v.getGraphics();
              /* If VolatileImage has no image memory,
              * we restore it and get the graphics for it */
              while (v.contentsLost()) {
                   if (v.validate(getGraphicsConfiguration()) == VolatileImage.IMAGE_INCOMPATIBLE) {
                        v = createVolatileImage(w,h);
                   gfx = v.createGraphics();
              /* this paints the ball etc */
              gfx.setColor(Color.black);
              gfx.fillRect(0,0,w,h);
              gfx.setColor(Color.cyan);
              gfx.fillOval(x,h/2-(size/2),size,size);
              g.drawImage(v,0,0,null); // draw the VolatileImage
         public void update(Graphics g) { // used for no blinking
              paint(g);
         public void keyPressed(KeyEvent e) {
              if (!done) done = true; // program exits on any key press
         public void keyReleased(KeyEvent e) {}
         public void keyTyped(KeyEvent e) {}
         public static void main(String[] args) {
              new Example();
    }

  • Looking for an Example of ShowHide in a Table Row

    JDev 9.0.5.2 ADF UIX
    Does anyone have example code for the ShowHide component in a table row?

    I did search the forum and there are no examples given for a table row. Many people have asked similar questions and have never received answers. I have searched the help documents and I looked at the UIX components guide. The component guide app gives an example of using showhide but not for a table row. The documentation says it can be done but I can't figure out how to do it. I don't use JHeadstart so I would like to see example uix code of how to get this to work.
    Thanks for any help.

  • Javacc and jjtree - looking for working example

    Hi all,
    I am doing a project that requires me to have an input of some java code. It is then run through a parser to tokenize it and it is then outputted into a grammar/syntax tree. My mentor has told me that I do not need to write this part (I will be doing work on tree once it is generated), and by the looks of it the parser can be 2-5k lines of code?
    Anyway, I have been looking at the examples that come with javacc and jjtree, and have those working etc. My problem is that i need to combine the two examples and i cant see anyway of doing that as the examples are vastly different. (one is a java parser the other is a 'stupid program language' tree generator, so they are using different grammars?)
    So my question is: is it possible to get a already made program that takes in java code and spits out a tree on the other end? If not what steps do i need to take to make this program :S
    Thanks!
    Scott.

    Here is a visual example
    http://www.bray.com/rollover.jpg
    The big picture would represent area "A"
    The smaller white outline box area "B"
    And area "C" would be down below
    Notice the thin white lines going from top to bottom and side
    to side represtent the crosshairs and will move around within the
    big picture as the mouse moves. Area "B" would remain centered on
    these crosshairs and would show a fullsize image of the area
    immediately around where the crosshairs are located. On a mouse
    click would change area "C" to pull up some detail text, photos,
    etc.
    The large picture will actually be a map as opposed to a pure
    photo as shown here, it was just easiest to grab a photo real quick
    for this visual example. I borrowed this photo from
    http://www.pezcyclingnews.com/
    I hope they don't mind to much.

Maybe you are looking for