Help in translating JAVA code into CF

Hi all!  I'm at the end of integrating an in-house calendar with Google calendars and all is working, however, I am stumped as to how implement callback functions.  Here's what I'm trying to do as outlined on http://code.google.com/p/google-api-java-client/source/browse/Batch.wiki?repo=wiki
What I need to do is this section right here:
JsonBatchCallback<Calendar> callback = new JsonBatchCallback<Calendar>() {
  public void onSuccess(Calendar calendar, HttpHeaders responseHeaders) {
    printCalendar(calendar);
    addedCalendarsUsingBatch.add(calendar);
  public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) {
    System.out.println("Error Message: " + e.getMessage());
And then later pass it to:
client.calendars().insert(entry1).queue(batch, callback);
I believe I can pass one function by passing just the name of the function, but BatchCallback has two functions.  Is this impossible to do in CF?
Thanks,
Ross.

1. In the future, please use a meaningful subject line, like "loop not performing last iteration." Just saying "Help in my java code" is useless. We know you need help with your Java code, else you wouldn't be posting here.
2. Repost your code without those annoying superfluous asterisks, and with proper indentation in the section that they are currently polluting. It's too hard to read as-is.

Similar Messages

  • How do you turn java code into an .exe or etc...

    I can't seem to figure out how to turn my java code into an executable in windows so that it runs by itself without a comipler, can someone help? (without using visual J++).

    I can't seem to figure out how to turn my java code
    into an executable in windows so that it runs by
    itself without a comipler, can someone help? (without
    using visual J++).I saw a tutorial on that, you might want to check it out.
    http://developer.java.sun.com/developer/onlineTraining/new2java/divelog/?frontpage-headlinesfeatures

  • Convert java code into UML

    hello,
    anybody knows a software convert java code into UML? Classes Diagram.
    for example JBuilder do that.
    // i use Netbeans.

    its not a speed issue although sometimes it can be painfully slow (but now slower that sun one). I constantly found myself getting into infinite error message loops (e.g. "incorrect input"... click ok... "incorrect input"... errr click ok.... "incorrec..." etc etc), and also it (relatively) regularly falls over. I tried to export diagrams as GIFs, and when I imported them into Word they looked ok, but when I printed them they printed negative!! I used about 100g of toner before I realised, and had to go thru all diagrams changing them to JPGs. Plus, I think the interface for 6 is a lot less intuitive than 4.2, and it's trying to be too feature rich. Personally I would never use it as a code editor as it's too big and lumbering. For me, it's a diagramming tool, but it doesn't even put pretty pictures as nodes on deployment diagrams!! I want pictures of workstations, PDAs and databases!! Only kidding...

  • Help in my java code?

    below is my code:
    import java.lang.String;
    import java.io.*;
    import java.util.*;
    public class DNASequence{
    public static void main(String args[])throws IOException{
      BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
      String sequenceAn = "ggctggacta ttgagatgcg ggaagagctg cagactccgg tggataaact atttgagacc cgatatcaag agaggaaact tcacaagaga agaagaggaa gctatcatta agttgcatga aatgctgggt aacaggtggt cagcaattgc agcaagatta ccaggacgca cagacaacga gataaaaaat gtatggcaca cccacttgaa gaag";
      String sequence = "DNA";
      String origin = "Prunus persica (peach)";
      String uppercase = sequenceAn.toUpperCase();
      int count = 0;
        for (int i = 0; i < sequenceAn.length(); i++) {
            char c = sequenceAn.charAt(i);
            if (c=='T' || c=='C' || c=='G' || c=='A' || c=='t' || c=='c' || c=='g' || c=='a') {
            count++;
        System.out.println("Sequence: " + sequence);
        System.out.println("Sequence length (nt): " + " " + count + "nt");
        *int counter = 1;*
    *//find how many times to substring*
    *int num = (int)Math.round(sequenceAn.length()/66);*
    *int firstParam = 0;*
    *int secondParam = 66;*
    *for (int i = 0; i < num; i++) {*
    *System.out.print(counter + " ");*
    *System.out.println(sequenceAn.substring(firstParam,secondParam)); //print from index 0 to index 64 = 65chars*
    *firstParam = firstParam + 66;*
    *secondParam = secondParam + 66;*
    *counter = counter + 60;*
        //System.out.println("Sequence annotation :" + uppercase);
        System.out.println("Organism origin :" + origin);
    }output is below:
    Sequence: DNA
    Sequence length (nt): 214nt
    *1 ggctggacta ttgagatgcg ggaagagctg cagactccgg tggataaact atttgagacc*
    *61 cgatatcaag agaggaaact tcacaagaga agaagaggaa gctatcatta agttgcatga*
    *121 aatgctgggt aacaggtggt cagcaattgc agcaagatta ccaggacgca cagacaacga*
    Organism origin :Prunus persica (peach)
    my problem now is it should be like this
    Sequence: DNA
    Sequence length (nt): 214nt
    *1 ggctggacta ttgagatgcg ggaagagctg cagactccgg tggataaact atttgagacc*
    *61 cgatatcaag agaggaaact tcacaagaga agaagaggaa gctatcatta agttgcatga*
    *121 aatgctgggt aacaggtggt cagcaattgc agcaagatta ccaggacgca cagacaacga*
    *181 gataaaaaat gtatggcaca cccacttgaa gaag*
    Organism origin :Prunus persica (peach)
    my another line is not display. please help me. thanks
    Edited by: williamku87_1 on Apr 6, 2010 10:56 AM
    Edited by: williamku87_1 on Apr 6, 2010 10:57 AM

    1. In the future, please use a meaningful subject line, like "loop not performing last iteration." Just saying "Help in my java code" is useless. We know you need help with your Java code, else you wouldn't be posting here.
    2. Repost your code without those annoying superfluous asterisks, and with proper indentation in the section that they are currently polluting. It's too hard to read as-is.

  • How to compile the java code into machine execution code?

    Does anyone can tell me how to compile java code into machine execution code on specific OS platform such as Windows2000 , UNIX �Ketc.
    Thanks a lot !

    Hi SIR
    It is very kind of you to give me so great informatin!
    Thanks a lot!
    Caton

  • Need help embedding mailchimp subscription code into dreamweaver.

    so I created my page in edge animate, and then I brought it over to adobe dreamweaver, and I dont know where or how to place my embeded mailchimp code? 
    <!-- Begin MailChimp Signup Form -->
    <link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
    <style type="text/css">
              #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif;  width:360px;}
              /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
                 We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
    </style>
    <div id="mc_embed_signup">
    <form action="http://kandied.us3.list-manage.com/subscribe/post?u=4525b320bd81872705a48ea05&id=4743a970b 1" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
              <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
        <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
        <div style="position: absolute; left: -5000px;"><input type="text" name="b_4525b320bd81872705a48ea05_4743a970b1" value=""></div>
              <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </form>
    </div>
    <!--End mc_embed_signup-->
    I keep trying to add it to it, but I either get noting or just the subscription box. does this happen due to my edge animate project?

    Ben Thank you so much for your reply! It helped me read the code and made me understand it better. I decided to make my own subscription box by making a symbol "Subscription" and inside this i created two more symbols called "Textbox" and "Submittbutton". I tried putting in part of the code from above under the div id, but it kept creating the whole text box behind the symbols in dreamweaver. How would you suggest I embed the code from above into my created submission box below?
             <div id="Stage_Center2_Subscription">
                    <div id="Stage_Center2_Subscription_subscribe"></div>
                    <div id="Stage_Center2_Subscription_Submittbutton">
                        <div id="Stage_Center2_Subscription_Submittbutton_Submitbutton">
                            <div id="Stage_Center2_Subscription_Submittbutton_Submitbutton_RoundRect2"></div>
                        </div>
                        <div id="Stage_Center2_Subscription_Submittbutton_text">
                            <div id="Stage_Center2_Subscription_Submittbutton_text_Text">Join</div>
                        </div>
                    </div>
                    <div id="Stage_Center2_Subscription_Textbox">
                        <div id="Stage_Center2_Subscription_Textbox_textbox">
                            <div id="Stage_Center2_Subscription_Textbox_textbox_RoundRect"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    </html>
    Thank you for taking the time to look at my question! I really appreciate it!
    Kyle

  • Run chm help file through java code

    hello,
    would you tell me how can i run a help.chm file using java code. i am trign this but no luck.
    first try
    Process pp=run.exec("C:/Program Files/Internet Explorer/IEXPLORE.exe ./res/bobftphelp.chm" );
    Second try
              Process pp=run.exec(" ./res/bobftphelp.chm" );
    It run fine a help.doc file but not help.chm file.
    please help me
    Thanka in advance
    Ravi Charan

    The second address given to that function, does it relate to the class that its being called from? cause i've got
    Runtime.getRuntime().exec("C:\\WINDOWS\\hh.exe .\\HelpFile_9_3.chm" );where HelpFile_9_3 is in the same folder as my class, but it won't work. Can anyone help?
    Also, can you search within a chm file from Java? If I get that above code working, I presume it'll open the help file to the main page. I'd like to search within that document for a word or phrase - possible?
    Thanks!
    Edited by: Pulkse.co.uk on Sep 10, 2008 8:18 AM

  • Help fix my java code!

    I am a java student in high school, and im attempting to create a program to figure how many items i can buy without going over a set price. I do not have all the equations in yet (i need to figure them out).... but can u help me fix my code please!!! More than likely all of my errors are from being new at java programming.... but please help lol! (if at all possible, i need to stay in the javax.swing and not any other import declarations)
    if i need to explain what im doing anywhere, just reply and say u don't understand it or something.
    import javax.swing.*;
    class SmeltingConversion
    public static void main(String args[])
      int amount, equation, coal_qty, iron_qty, coal_price, iron_price, gold_qty, iron_input, gold_input, coal_input, mythreal_input, mythreal_qty, adament_input, adament_qty, rune_input, rune_qty, select;
      JOptionPane.showMessageDialog(null, "Created by:\n\tFinalFntsy3\n\nCopyright 2006", "Smelting Conversions", JOptionPane.PLAIN_MESSAGE);
      select = JOptionPane.showInputDialog("Please type one of the following numbers: 1(Bronze), 2(Iron), 3(Steel), 4(Mythreal), 5(Adament), 6(Rune).");
       switch(select)
       case 1:
         gold_input = JOptionPane.showInputDialog("Please enter the amount of gold available");
         tin_input = JOptionPane.showInputDialog("Please enter the price per piece of tin.");
         copper_input = JOptionPane.showInputDialog("Please enter the price per piece of copper."); 
         gold_qty=Integer.parseInt(gold_input);
         tin_qty=Integer.parseInt(tin_input);
         copper_qty=Integer.parseInt(copper_input);
         equation = gold_qty/(tin_price + copper_price);
         equation = amount;
         JOptionPane.showMessageDialog(null, " ", "Bronze Conversion", JOptionPane.INFORMATION_MESSAGE);
         break;
       case 2:
         gold_input = JOptionPane.showInputDialog("Please enter the amount of gold available");
         coal_input = JOptionPane.showInputDialog("Please enter the price per piece of coal ore.");
         iron_input = JOptionPane.showInputDialog("Please enter the price per piece of iron ore."); 
         gold_qty=Integer.parseInt(gold_input);
         coal_qty=Integer.parseInt(coal_input);
         iron_qty=Integer.parseInt(iron_input);
         equation = gold_qty/(iron_price + (2*coal_price));
         equation = amount;
         JOptionPane.showMessageDialog(null, " ", "Steel Conversion", JOptionPane.INFORMATION_MESSAGE);
         break;
       case 3:
         gold_input = JOptionPane.showInputDialog("Please enter the amount of gold available");
         coal_input = JOptionPane.showInputDialog("Please enter the price per piece of coal ore.");
         mythreal_input = JOptionPane.showInputDialog("Please enter the price per piece of mythreal ore."); 
         gold_qty=Integer.parseInt(gold_input);
         coal_qty=Integer.parseInt(coal_input);
         mythreal_qty=Integer.parseInt(mythreal_input);
         equation = gold_qty/(tin_qty + copper_qty);
         equation = amount;
         JOptionPane.showMessageDialog(null, " ", "Mythreal Conversion", JOptionPane.INFORMATION_MESSAGE);
         break;
       case 4:
         gold_input = JOptionPane.showInputDialog("Please enter the amount of gold available");
         coal_input = JOptionPane.showInputDialog("Please enter the price per piece of coal ore.");
         adament_input = JOptionPane.showInputDialog("Please enter the price per piece of adament ore."); 
         gold_qty=Integer.parseInt(a_input);
         coal_qty=Integer.parseInt(coal_input);
         adament_qty=Integer.parseInt(adament_input);
         equation = gold_qty/(tin_qty + copper_qty);
         equation = amount;
         JOptionPane.showMessageDialog(null, " ", "Adament Conversion", JOptionPane.INFORMATION_MESSAGE);
         break;
       case 5:
         gold_input = JOptionPane.showInputDialog("Please enter the amount of gold available");
         coal_input = JOptionPane.showInputDialog("Please enter the price per piece of coal ore.");
         rune_input = JOptionPane.showInputDialog("Please enter the price per piece of rune ore."); 
         gold_qty=Integer.parseInt(a_input);
         coal_qty=Integer.parseInt(coal_input);
         rune_qty=Integer.parseInt(rune_input);
         equation = gold_qty/(tin_qty + copper_qty);
         equation = amount;
         JOptionPane.showMessageDialog(null, " ", "Rune Conversion", JOptionPane.INFORMATION_MESSAGE);
         break;
      JOptionPane.showMessageDialog(null, "Total amount of coal needed:\n \t" + a + "\nTotal amount of iron needed:\n \t", "Smelting Conversions", JOptionPane.PLAIN_MESSAGE);
    }

    There are a lot of things to fix within your Program.
    Why don't you try to fix your compiler errors by yourself before you ask others to do it for you ?
    JOptionPane.showInputDialog returns a String and that can't be convertet to an int without parsing the String.
    Some variables ar simply not declared and so on.
    I've tried to fix the first switich case for you so you can see how it could possibly look like
    int  coal_qty, iron_qty, coal_price, iron_price, gold_qty, iron_input, coal_input, mythreal_input, mythreal_qty, adament_input, adament_qty, rune_input, rune_qty;
      int selectId;
      String select ;
      double amount = 0.0;
      double equation;
      JOptionPane.showMessageDialog(null, "Created by:\n\tFinalFntsy3\n\nCopyright 2006", "Smelting Conversions", JOptionPane.PLAIN_MESSAGE);
      select = JOptionPane.showInputDialog("Please type one of the following numbers: 1(Bronze), 2(Iron), 3(Steel), 4(Mythreal), 5(Adament), 6(Rune).");
      selectId = Integer.parseInt(select);
    switch(selectId)
       case 1:
           String gold_input;
           String tin_input;
           String copper_input;
           double tin_price = 1.0;
           double copper_price = 1.0;
         gold_input = JOptionPane.showInputDialog("Please enter the amount of gold available");
         tin_input = JOptionPane.showInputDialog("Please enter the price per piece of tin.");
         copper_input = JOptionPane.showInputDialog("Please enter the price per piece of copper."); 
         tin_price = Double.parseDouble(tin_input);
         copper_price = Double.parseDouble(copper_input);
         gold_qty=Integer.parseInt(gold_input);
         equation = gold_qty/(tin_price + copper_price);
         equation = amount;
         JOptionPane.showMessageDialog(null, " ", "Bronze Conversion", JOptionPane.INFORMATION_MESSAGE);
         break;
       }

  • Help! typed a code into Terminal and not Microsoft Word is all messed up

    Hi everyone!
    I'm hoping (really hoping!) someone will be able to help me.
    I wanted my MAC desktop to save screenshots as JPEG images. (For a book cover I'm trying to design myself)
    So I found an online "E-How" article that suggested I copy and paste two codes into the "Terminal." I did and it worked.
    However, when I opened up MS Word ('11) for MAC, now my Word is completely messed up.  It has only about 30 fonts to choose from, it doesn't recognize the most basic commands.
    How do I undo that Code I typed into the Terminal and get my desktop back to how it was???
    Thanks!!

    Hello, it's unlikely those commands directly caused your Word problem.
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partition & use Disk Utility from there to Repair the Disk, then Repair Permissions.
    Any change?

  • Help in using JAVA code in SAP XI

    Hi,
    I have some java and jar files, I want to use those files through SAP XI.
    Scenario:
    we need to do encryption of some data field which is coming as input to XI, Now here we have a readymade code for encryption in JAVA that we have to use. Now we have imported all the JAVA and jar files in the XI. and written a small code in XI editor which is calling some function of JAVA file. But we are getting error that system is not able to resolve the function name.
    I think we need to define class path somewhere in XI.
    Please help me to resolve this issue.
    Thanks.

    Hi Vin,
    Here's all you should need to do:
    1) Import the jar files into the IR as an Imported Archive.
    2) You can then reference this from Message Maps (and XSLT maps). To do this in a Message Map:
    a) Create a user-defined function.
    b) Make sure to include the class in the import section. com.company.xi.MyClass for example.
    The Imported Archive and the Message Map (or XSLT map) need to be in the same software component. If they're not, you'll need to setup dependencies in the SLD between the software components.
    Thanks,
    Jesse

  • How to Save a File form a JAVA code into the CDrive

    Hello, i need to create a file and save it in the Cdrive of my computer.
    I could create the file and get the command prompt to ask me the file name to save it.
    However, my problem is that the file is saved in the Cdrive with nothing inside! I can manage to save the file and give it a name, but i can't save the inside of it... the page comes blank...
    if someone could help me and tell me why the inside isn't there and how to fix it, it could be very very helpfull!
    thx
    waiting for any reply
    the part where i know i got it wrong is this:
    // Save the File.txt in the Cdrive + MSG
                   System.out.println( FILENAME_MSG ) ;
                   BufferedReader br = new BufferedReader( new InputStreamReader ( System.in ),1 ) ;
                   PeastBase = br.readLine() ;
                   FileOutputStream fout = new FileOutputStream ( PeastBase ) ;
                   OutputStreamWriter out = new OutputStreamWriter ( fout , "Shift_JIS" ) ;
                   // Write in File
                   out.write( CopyBase ) ;
                   // Save PeastBase
                   out.flush() ;
                   // Close the Bufferedwriter
                   out.close() ;
    Anyway these are the complete code in case of need:
    import java.io.*;
    import java.util.ArrayList;
    class Exp11 {
         public static void main(String[] args) throws IOException{
              try{
                   File objCopyBaseFile = new File( "aaa" ) ;
                   File objPeastBaseFile = new File( "bbb" ) ;
                   //MAX Letters and Lines Input
                   final int MAX_COLS = 10 ;
                   final int MAX_ROWS = 10 ;
                   final String START_MSG = "Input any LETTER" ;
                   final String START_MSG1 = "10 LETTERS per Line, 10 LINES Max is Possible" ;
                   final String START_MSG2 = "Input w will Save the FILE and FINISH" ;
                   final String COUNT_STRING_ERROR = "Letters Input per Line is OVER" ;
                   final String COUNT_ROW_ERROR = "Lines Number is OVER" ;
                   final String FILENAME_MSG = "Input the File Name" ;
                   String PeastBase ;
                   String InputBase ;
                   String cpBuffer ;
                   String CopyBase ;
                   int rownumber ;
                   PeastBase = " " ;
                   InputBase = "w" ;
                   cpBuffer = " " ;
                   CopyBase = " " ;
                   rownumber = 0 ;
                   FileOutputStream fos = new FileOutputStream( "fos.txt" ) ;
                   OutputStreamWriter ow = new OutputStreamWriter( fos , "EUC-JP" ) ;
                   BufferedWriter bw = new BufferedWriter( new FileWriter ( "out.txt", true )) ;
                   // Start MSG
                   System.out.println( START_MSG ) ;
                   System.out.println( START_MSG1 ) ;
                   System.out.println( START_MSG2 ) ;
                   // Input
                   ArrayList<String> array = new ArrayList<String>() ;
                   int i ;
                   i = 0 ;
                   do {
                        BufferedReader br = new BufferedReader( new InputStreamReader ( System.in ),1 ) ;
                        PeastBase = br.readLine() ;
                        // Let's Count
                        if( !PeastBase.equals( InputBase) ){
                             rownumber ++ ;
                             // Check the Input letters
                             if ( countString(PeastBase,MAX_COLS )){
                                  array.add(PeastBase) ;
                             else{
                                  System.out.println( COUNT_STRING_ERROR ) ;
                             // Check the Lines
                             if ( countRow( rownumber,MAX_ROWS )){
                                  array.add( PeastBase ) ;
                             else{
                                  System.out.println( COUNT_ROW_ERROR ) ;
                   } while ( !PeastBase.equals( InputBase ) ) ;
                   // enter the data
                   for( int      j=0;j<array.size();j++ ){
                        System.out.println( "How Many Time Input==>"+array.get(j) ) ;
                   // Save the File.txt in the Cdrive + MSG
                   System.out.println( FILENAME_MSG ) ;
                   BufferedReader br = new BufferedReader( new InputStreamReader ( System.in ),1 ) ;
                   PeastBase = br.readLine() ;
                   FileOutputStream fout = new FileOutputStream ( PeastBase ) ;
                   OutputStreamWriter out = new OutputStreamWriter ( fout , "Shift_JIS" ) ;
                   // Write in File
                   out.write( CopyBase ) ;
                   // Save PeastBase
                   out.flush() ;
                   // Close the Bufferedwriter
                   out.close() ;
              catch ( IOException e ){
                   System.out.println( e ) ;
              finally{
         static boolean countString ( String bufString , int maxCount ) throws IOException{
              int StringCnt ;
              StringCnt = 0 ;
              // Count Letters per Lines
              StringCnt = bufString.length() ;
              if( maxCount>= StringCnt ){
                   return true ;
              else{
                   return false ;
         static boolean countRow ( int rownumber , int maxLine) throws IOException{
              int StringLine ;
              StringLine = 0 ;
              if( maxLine>= rownumber ){
                   return true ;
              else{
                   return false ;
    PLEASE ANY HELP
    THX

    I'm not great with IO yet, but I see you use
    out.write(CopyBase);But I only see you initialize CopyBase to equal an empty String.
    So it should be writing nothing to the file.

  • Help me doing java code

    Iam having a file "source.txt" in which i have HTML source of a HTML file containing hyperlinks..for example,The following is the content of file source.txt
    <HTML>
    <BODY>
    Yahoo
    Rediff
    Google
    </BODY>
    </HTML>
    From the above notepad file i have to extract only the links from it and save it in another notepad file say links.txt and the content should be
    www.yahoo.com
    www.rediff.com
    www.google.com
    For this i need a Java program..
    Can u please help me out for this...i need the code please..

    import java.util.regex.*;
    import java.io.*;
    import java.nio.*;
    import java.nio.charset.*;
    import java.nio.channels.*;
    public class CharBufferExample {
    public static void main(String[] args) throws Exception {
    // Create a pattern to match comments
    Pattern p = Pattern.compile("<a href[\"]{0,1}([a-zA-Z0-9.-]{0,})[\"]{0,1}[a-zA-Z0-9.- =\'\"_]{0,}>");
    // Get a Channel for the source file
    File f = new File("source.txt");
    FileInputStream fis = new FileInputStream(f);
    FileChannel fc = fis.getChannel();
    // Get a CharBuffer from the source file
    ByteBuffer bb = fc.map(FileChannel.MAP_RO, 0, (int)fc.size());
    Charset cs = Charset.forName("8859_1");
    CharsetDecoder cd = cs.newDecoder();
    CharBuffer cb = cd.decode(bb);
    // Run some matches
    Matcher m = p.matcher(cb);
    while (m.find()) {
    String str = m.group(1);
    System.out.println("Found url: "+str);
    // code to add that url to any array/vector/other containers
    // arr=str;
    // i++;

  • Needed help with updating java code

    Hello all,
    Let me begin by let you know I am not a programmer and I have tried to solve this by reading on the net. I am a network admin so I tech knowledge but no programming.
    I have a webcam sending a Jpg to an FTP site and there I have used an applet called view.class to refresh once a second.
    site:http://70.154.170.253/webcamold.html
    My problems is now that it refreshes the same image over and over. It refreshes the cached image not the new image.
    From reading I suspect that it has to do with the newer version of java (it used to work fine).
    I have tried using JavaCam but same issue it just refreshes cached image. Also image flickers, the applet I am trying to fix was really smooth.
    I have also tried to compile code that I found on this forum but I got error dealing with deprecated code.
    Any help would be greatly appreciated!!!
    Code:
    import java.applet.Applet;
    import java.awt.*;
    import java.io.PrintStream;
    public class View extends Applet
    implements Runnable
    public void init()
    setBackground(Color.white);
    String s = getParameter("refresh");
    if(s == null)
    update = 30;
    else
    try
    update = Integer.parseInt(s);
    catch(Exception _ex)
    update = 30;
    filename = getParameter("picture");
    if(filename == null)
    System.out.println("No filename given as parameter.");
    md = new MediaTracker(this);
    off = createImage(size().width, size().height);
    refreshImage();
    public void paint(Graphics g)
    g.drawImage(off, 0, 0, this);
    public void update(Graphics g)
    paint(g);
    public void refreshImage()
    img = getImage(getDocumentBase(), filename);
    md.addImage(img, 0);
    try
    md.waitForID(0);
    catch(Exception exception)
    exception.printStackTrace();
    Graphics g = off.getGraphics();
    g.drawImage(img, 0, 0, this);
    img.flush();
    public void run()
    while(th != null)
    try
    refreshImage();
    repaint();
    Thread.sleep(update * 1000);
    catch(Exception exception)
    System.out.println("Error when thread was supposed to sleep: " + exception.getMessage());
    public void start()
    if(th == null)
    th = new Thread(this);
    try
    th.start();
    return;
    catch(Exception exception)
    System.out.println("Couldn't start thread: " + exception.getMessage());
    return;
    } else
    return;
    public void stop()
    if(th != null)
    th.stop();
    th = null;
    public void destroy()
    stop();
    public View()
    update = 30;
    Thread th;
    String filename;
    int update;
    Image img;
    Image off;
    MediaTracker md;

    This is compile error free code and regarding your issues i don't think am good at this stuff
    import java.applet.Applet;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.MediaTracker;
    public class View extends Applet implements Runnable {
         Thread th;
         String filename;
         int update;
         Image img;
         Image off;
         MediaTracker md;
         public void init() {
              setBackground(Color.white);
              String s = getParameter("refresh");
              if (s == null) {
                   update = 30;
              } else {
                   try {
                        update = Integer.parseInt(s);
                   } catch (Exception _ex) {
                        update = 30;
              filename = getParameter("picture");
              if (filename == null) {
                   System.out.println("No filename given as parameter.");
              md = new MediaTracker(this);
              off = createImage(size().width, size().height);
              refreshImage();
         public void paint(Graphics g) {
              g.drawImage(off, 0, 0, this);
         public void update(Graphics g) {
              paint(g);
         public void refreshImage() {
              img = getImage(getDocumentBase(), filename);
              md.addImage(img, 0);
              try {
                   md.waitForID(0);
              } catch (Exception exception) {
                   exception.printStackTrace();
              Graphics g = off.getGraphics();
              g.drawImage(img, 0, 0, this);
              img.flush();
         public void run() {
              while (th != null) {
                   try {
                        refreshImage();
                        repaint();
                        Thread.sleep(update * 1000);
                   } catch (Exception exception) {
                        System.out.println("Error when thread was supposed to sleep: "
                                  + exception.getMessage());
         public void start() {
              if (th == null) {
                   th = new Thread(this);
                   try {
                        th.start();
                        return;
                   } catch (Exception exception) {
                        System.out.println("Couldn't start thread: "
                                  + exception.getMessage());
                   return;
              } else {
                   return;
         public void stop() {
              if (th != null) {
                   th.stop();
                   th = null;
         public void destroy() {
              stop();
         public View() {
              update = 30;
    }

  • Translate C code into LabVIEW

    Hi, I have a function in C/C++, and I am wondering how I can have it translated into LabVIEW.
    Thanks,
    Andrea

    There are three ways to use the code in LV.
    First create a DLL or .Net assembly and call it from LV.
    Second use a Formula Node. You can enter your C code directly there.
    Third rewrite the code in LV.
    Which is approiate will depend on your Code.
    Rewriting in LV will cost most work and you need to have a good experience in programming in C and LV.
    Most language constructs of C are available in LV but not all, e. g. there is no while loop. The While loop in LV is a do { ...} while loop. It will execute at least once. For a while loop you must use a Case with a containing While loop. since your termination expression must be used twice create a subVI for it.
    Another thing which will go not easy to handle is the switch statement. Basicly the Case structure is the same but you must take care of the following code in C:
    case <value1>
    case <value2>
    break;
    case <value3>
    break;
    You must handle this by additional nested Case structures.
    Most runtime functins are available or can be build using two or more LV function, e. g. fprintf can be created by Format Into String followed by a File Write.
    If your code contains functions pointer thats no problem. VI references are function pointers. Open VI Reference creates a function pointer and Call by Reference uses it.
    Since you are mentioning C++ you may need to have a look to the object oriented programming in LV.
    OK, I'm the last one, but Ihe written the most text and some hints.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Translating html code into.. web page

    If I am downloading an HTML document from the WWW, i.e. a web page, how can I handle it so that what is actually shown on my GUI component (which is of type JTextArea) is the final "page" (as shown by any standard Web browser) rather than just html code?

    You can use a JEditorPane with its content type set to "text/html".
    You may it helps to call editorPane.setEditable(false) as well.
    Have a look at the Javadocs for JEditorPane for examples.
    Hope this helps.

Maybe you are looking for

  • Unhiding photos? Iphoto 09 version 8.1.2

    No matter what I try... I mistakenly hide photos. I found them in the 'trash' and restored them to my library and eventually got them to appear in the 'faces' library but they have an X in the upper right hand corner. I want to remove this so it appe

  • Cannot "save as" Acrobat 9 Professional

    error message: "The document could not be saved. There was a problem reading this document (14)." os xp professional - please help.

  • Purchase Order flow in ASCP

    Hi eveyone. Mi question is: after that these next steps complete: Description of Data Flow: New purchase orders or requisitions in approved status. Snapshot does not contain that newly entered purchase order or requisition. The MRP_AP_xxxxx_V views d

  • Development environment for 10g R2

    Guys, I need to setup a development environment for oracle 10g r2 forms development. I am a new to oracle and due to downsizing we lost our DBAs so I am on my own and need your huge support......... Current settings: Oracle on the server: Oracle 10g

  • Open pdf in reader, not photoshop

    I just installed Photoshop cs2. How do I change the setting to open pdf files in Reader, not Photoshop? Thanks, Karen