Drag control example and how to save an indicator value??

Hi everyone,
I want to drag boolean buttons on my front panel in the run time, how can I do it?
I remember I have seen an ni example for that, it's a card on the front panel, but I don't remember the name TT anybody knows?
and the second question is how to save an indicator value, like the first time you set the value and close the vi and run it again, the value will remain unless you change it in the second run time?
thanks in advance 
Solved!
Go to Solution.

THe attached (in LV 8.6) is a quick and dirty dragging example.
When a mouse down event is detected the offset between the mouse and the top left corner is calculated and cached in a shift register.
Mouse moves use the offset to etermine the new location.
Mosue up clears a boolean used to track if we are actively dragging at the moment.
Have fun!
Ben
Message Edited by Ben on 04-15-2009 07:54 AM
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Attachments:
Drag.vi ‏11 KB
Drag_This.PNG ‏59 KB

Similar Messages

  • Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it. 
    Alex D
    Applications Engineer
    National Instruments

  • I want to renew my window and how to save backups which i hav on my itunes ??

    i want to renew my window and how to save backups which i hav on my itunes ??

    See Backup your iTunes for Windows library with SyncToy. As long as you copy your entire library over to the new/rebuilt computer your devices should sync with the library and will be backed up on the first sync. If you really want to backup the device backups see this support document iTunes: About iOS backups and backup the device backup folders, then restore them into your new profile.
    tt2

  • How to save a new value for Set command variable

    I am using SET [variable = [String]] to update Set variable. It works fine. But when I restart MSDOS Prompt, I get old value for variable.
    How to save a new value for SET command variable?
    I am using Windows XP.

    And this has to do with java how?

  • How to add attribute to UME and how to retrive the attribute value

    Hi Gurus,
    I have developped an application that retriving the data from back end for that we need to give input values .
    I have got the Logged user from the Iuser But Sales Organization of User [from user profile] and Brand value [from user profile] I want these input put values need to pass as a input .
    For this how can get the sales org and Brand value.
    Give me suggestions for this or how to pass attributes to UME and how to capture it.
    Advance thanks.
    thanks
    Lohi.

    Check if there are any available function modules for this functionality. One of the FM that comes to my mind is:
    a) BAPI_USER_GET_DETAIL
    Check with your SD guys , if there exists any such function module.
    Regards,
    Subramanian V.

  • How to include limit switches into my control loop and how to access them through Labview

    I'm developing a six degrees of freedom machine with servo motors,UMI flex6 and Labview-5.1.I was unable to access the limitswithes.So I would like to know the connections diagram,UMIflex6 board settings and the Vi's to be included in the program.please help me out in solving this problem.

    Hi Kolakanuru,
    Thanks for using our discussion forums. How you connect your limit switches depends on what type of motion board you are using. For example, if you look at the connection diagram for a PCI-7344, you can see that Forward Limit switches connect to pins 39, 45, 51, and 57. These will then pin out directly to the UMI. For the connection diagram for your particular motion control board, you can go to www.ni.com/manuals and pull up the necessary information. In regards to reading this in LabVIEW, the first thing you will want to check out is Measurement and Automation Explorer. In the interactive windows for your board, you can check the limit switch status there- Press your limit switch on and off and make sure that it changes the LED in MAX. Once that i
    s all set, then you can go into LabVIEW and use the "Read Limit Status" VI which you can find in Functions>>All Functions>>NI Measurements>>Motion>>FlexMotion>>Motion I/O palette. Good luck with your application.
    Regards
    Dan
    National Instruments

  • How to get image using Http and how to save in Smulator

    Hi guys,
    Am working in black berry bold. i dont know how to get image using htp connection and one more thing i need to save this image in side simulator directory............. what are the specific API i should...
    Guide me.........

    If you want the input image size you need to pass it in as parameters.
    A discussion thread on this topic is:
    http://forums.adobe.com/thread/29948
    -- Daniel R. <[email protected]> http://danielr.neophi.com/

  • How can change the hair to an image every time and how can save the edit image into albums give me code

    HI, I am small iphone developer,i have one problem in my app,please give the guidence to me.
    THIS IS MY PROBLEM:
              I HAVE SELECTED ONE PICTURE FROM ALBUMS OR TAKE PICTURE FROM CAM SO I WANT TO CHANGE THE HAIR STYLES PART WITH ANOTHER HAIR STYELS AND SAVE THE PICTURE INTO ALBUMS HOW CAN GENRATE THE CODE OR LOGIC TO ME......I AM TRYING IT FROM 3WEEKS SO COULD YOU PLEASE GIVE ME GUIDENCE TO ME.................

    HI, I am small iphone developer,i have one problem in my app,please give the guidence to me.
    THIS IS MY PROBLEM:
              I HAVE SELECTED ONE PICTURE FROM ALBUMS OR TAKE PICTURE FROM CAM SO I WANT TO CHANGE THE HAIR STYLES PART WITH ANOTHER HAIR STYELS AND SAVE THE PICTURE INTO ALBUMS HOW CAN GENRATE THE CODE OR LOGIC TO ME......I AM TRYING IT FROM 3WEEKS SO COULD YOU PLEASE GIVE ME GUIDENCE TO ME.................
    Sir I am did it by using Objcetive-C code in iphone as fallows
    demoprojectViewController.h
    #import <UIKit/UIKit.h>
    @interface demoprojectViewController : UIViewController<UIImagePickerControllerDelegate,UINavigationControllerDelegate >
        UIImageView *imageView,*editingimage,*maskimage;
         UIButton *takePictureButton;
        UIButton *selectFromCameraRollButton;
        UIView *myview;
    @property(nonatomic,retain)IBOutlet UIImageView *imageView;
    @property(nonatomic,retain)IBOutlet UIImageView *maskimage;
    @property(nonatomic,retain)IBOutlet UIImageView *editingimage;
    @property(nonatomic,retain)IBOutlet UIButton *takePictureButton;
    @property(nonatomic,retain)IBOutlet UIButton *selectFromCameraRollButton;
    @property(nonatomic,retain )IBOutlet UIView *myview;
    - (IBAction)getCameraPicture:(id)sender;
    - (IBAction)selectExistingPicture;
    -(IBAction)pickHair:(id)sender;
    -(IBAction)done;
    -(IBAction)back;
    @end
    demoprojectViewController.m
    #import "demoprojectViewController.h"
    @implementation demoprojectViewController
    @synthesize imageView,editingimage,maskimage;
    @synthesize takePictureButton;
    @synthesize selectFromCameraRollButton;
    @synthesize myview;
    CGFloat lastScaleFactor = 1;
    CGFloat netRotation;
    CGPoint netTranslation;
    NSArray *images;
    int imageIndex = 0;
    - (void)didReceiveMemoryWarning
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];
        // Release any cached data, images, etc that aren't in use.
    #pragma mark - View lifecycle
    // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad
       // maskimage=[[UIImageView alloc]initWithFrame:CGRectMake(50, 50, 150, 150)];
        //maskimage.image=[UIImage imageNamed:@"1.png"];
        if ([UIImagePickerController isSourceTypeAvailable:
              UIImagePickerControllerSourceTypeCamera]) {
            takePictureButton.hidden = NO;
            selectFromCameraRollButton.hidden = NO;
           UITapGestureRecognizer *tapGesture =
            [[UITapGestureRecognizer alloc]
             initWithTarget:self
             action:@selector(handleTapGesture:)];
            tapGesture.numberOfTapsRequired = 1;
            [maskimage addGestureRecognizer:tapGesture];
            [tapGesture release];
            UIPinchGestureRecognizer *pinchGesture =
            [[UIPinchGestureRecognizer alloc]
             initWithTarget:self
             action:@selector(handlePinchGesture:)];
            [maskimage addGestureRecognizer:pinchGesture];
            [pinchGesture release];
            ///---rotate gesture---
            UIRotationGestureRecognizer *rotateGesture =
            [[UIRotationGestureRecognizer alloc]
             initWithTarget:self
             action:@selector(handleRotateGesture:)];
            [maskimage addGestureRecognizer:rotateGesture];
            [rotateGesture release];
            //---pan gesture---
            UIPanGestureRecognizer *panGesture =
            [[UIPanGestureRecognizer alloc]
             initWithTarget:self
             action:@selector(handlePanGesture:)];
            [maskimage addGestureRecognizer:panGesture];
            [panGesture release];
            //---swipe gesture---
            images = [[NSArray alloc] initWithObjects:
                      @"1.png",
                      @"2.png",
                      @"3.png", nil];
            //---right swipe (default)---
            UISwipeGestureRecognizer *swipeGesture =
            [[UISwipeGestureRecognizer alloc]
             initWithTarget:self
             action:@selector(handleSwipeGesture:)];
            [maskimage addGestureRecognizer:swipeGesture];
            [swipeGesture release];
            //---left swipe---
            UISwipeGestureRecognizer *swipeLeftGesture =
            [[UISwipeGestureRecognizer alloc]
             initWithTarget:self
             action:@selector(handleSwipeGesture:)];
            swipeLeftGesture.direction = UISwipeGestureRecognizerDirectionLeft;
            [maskimage addGestureRecognizer:swipeLeftGesture];
            [swipeLeftGesture release];
        [super viewDidLoad];
    -(IBAction) handleTapGesture:(UIGestureRecognizer *) sender {
        if (sender.view.contentMode == UIViewContentModeScaleAspectFit)
            sender.view.contentMode = UIViewContentModeCenter;
        else
            sender.view.contentMode = UIViewContentModeScaleAspectFit;
    -(IBAction) handlePinchGesture:(UIGestureRecognizer *) sender {
        CGFloat factor = [(UIPinchGestureRecognizer *) sender scale];
        if (factor > 1) {
            //---zooming in---
            sender.view.transform = CGAffineTransformMakeScale(
                                                               lastScaleFactor + (factor-1),
                                                               lastScaleFactor + (factor-1));
        } else {
            //---zooming out---
            sender.view.transform = CGAffineTransformMakeScale(
                                                               lastScaleFactor * factor,
                                                               lastScaleFactor * factor);
        if (sender.state == UIGestureRecognizerStateEnded){
            if (factor > 1) {
                lastScaleFactor += (factor-1);
            } else {
                lastScaleFactor *= factor;
    //---handle rotate gesture---
    -(IBAction) handleRotateGesture:(UIGestureRecognizer *) sender {
        CGFloat rotation = [(UIRotationGestureRecognizer *) sender rotation];
        CGAffineTransform transform = CGAffineTransformMakeRotation(
                                                                    rotation + netRotation);
        sender.view.transform = transform;
        if (sender.state == UIGestureRecognizerStateEnded){
            netRotation += rotation;
    //---handle pan gesture---
    -(IBAction) handlePanGesture:(UIGestureRecognizer *) sender {
        CGPoint translation =
        [(UIPanGestureRecognizer *) sender translationInView:maskimage];
        sender.view.transform = CGAffineTransformMakeTranslation(
                                                                 netTranslation.x + translation.x,
                                                                 netTranslation.y + translation.y);
        if (sender.state == UIGestureRecognizerStateEnded){
            netTranslation.x += translation.x;
            netTranslation.y += translation.y;
    -(IBAction) handleSwipeGesture:(UIGestureRecognizer *) sender {
        UISwipeGestureRecognizerDirection direction =
        [(UISwipeGestureRecognizer *) sender direction];
        switch (direction) {
            case UISwipeGestureRecognizerDirectionUp:
                NSLog(@"up");
                break;
            case UISwipeGestureRecognizerDirectionDown:
                NSLog(@"down");
                break;
            case UISwipeGestureRecognizerDirectionLeft:
                imageIndex++;
                break;
            case UISwipeGestureRecognizerDirectionRight:
                imageIndex -- ;
                break;
            default:
                break;
        imageIndex = (imageIndex < 0) ? ([images count] - 1):
        imageIndex % [images count];
        imageView.image = [UIImage imageNamed:
                           [images objectAtIndex:imageIndex]];
    #pragma mark -
    - (IBAction)getCameraPicture:(id)sender {
        UIImagePickerController *picker =
        [[UIImagePickerController alloc] init];
        picker.delegate = self;
        //picker.allowsImageEditing = YES;
        picker.sourceType = (sender == takePictureButton) ?
        UIImagePickerControllerSourceTypeCamera :
        UIImagePickerControllerSourceTypeSavedPhotosAlbum;
        [self presentModalViewController:picker animated:YES];
        [maskimage removeFromSuperview];
        [picker release];
    - (IBAction)selectExistingPicture {
        if ([UIImagePickerController isSourceTypeAvailable:
             UIImagePickerControllerSourceTypePhotoLibrary]) {
            UIImagePickerController *picker =
            [[UIImagePickerController alloc] init];
            picker.delegate = self;
            picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
            [self presentModalViewController:picker animated:YES];
            [maskimage removeFromSuperview];
            [picker release];
        else {
            UIAlertView *alert = [[UIAlertView alloc]
                                  initWithTitle:@"Error accessing photo library"
                                  message:@"Device does not support a photo library"
                                  delegate:nil
                                  cancelButtonTitle:@"Drat!"
                                  otherButtonTitles:nil];
            [alert show];
            [alert release];
    #pragma mark -
    - (void)imagePickerController:(UIImagePickerController *)picker
            didFinishPickingImage:(UIImage *)image
                      editingInfo:(NSDictionary *)editingInfo {
        imageView.image = image;
        [picker dismissModalViewControllerAnimated:YES];
    - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
        [picker dismissModalViewControllerAnimated:YES];
    - (IBAction)btnSave_Clicked:(id)sender;
        UIImageWriteToSavedPhotosAlbum(editingimage.image, nil, nil, nil);
        //UIImageWriteToSavedPhotosAlbum(imageView.image, nil, nil, nil);
        UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Success" message:@"Image saved successfully to iPhone photo albums..." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
        [alert show];
        [alert release];
    -(IBAction)pickHair:(id)sender;
           //[maskimage setMultipleTouchEnabled:YES];
       // [maskimage setUserInteractionEnabled:YES];
        //[maskimage setContentMode:UIViewContentModeScaleAspectFit];
        maskimage.image=[UIImage imageNamed:@"1.png"];
        [imageView addSubview:maskimage];
    -(IBAction)done
        NSLog(@"hiafjdkfj");
        UIGraphicsBeginImageContext(imageView.image.size); 
        CGRect rect1 = CGRectMake(netTranslation.x,netTranslation.y,maskimage.image.size.width , maskimage.image.size.height);
        CGRect rect = CGRectMake(0, 0, imageView.image.size.width, imageView.image.size.height);
        [imageView.image drawInRect:rect]; 
        [maskimage.image drawInRect:rect1]; 
        UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext(); 
        UIGraphicsEndImageContext(); 
        [editingimage setImage:resultingImage];
        [myview addSubview:editingimage];
        [self.view addSubview:myview];
    -(IBAction)back
        [myview removeFromSuperview];
        //[editingimage removeFromSuperview];
    -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
        UITouch *touch = [[event allTouches] anyObject];
        CGPoint location = [touch locationInView:touch.view];
        maskimage.center = location;
    -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
        [self touchesBegan:touches withEvent:event];
    - (void)viewDidUnload
        self.imageView = nil;
        self.maskimage=nil;
        self.takePictureButton = nil;
        self.selectFromCameraRollButton = nil;
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceO rientation
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    - (void)dealloc {
        [imageView release];
        [images release];
        [takePictureButton release];
        [selectFromCameraRollButton release];
        [super dealloc];
    @end
    but i can not put the hair to the proper place means on edit image when am saving the image please help meee

  • How to ask for an array and how to save the values

    I'm supposed to be learning the differences between a linear search and a binary search, and the assignment is to have a user input an array and search through the array for a given number using both searches. My problem is that I know how to ask them how long they want their array to be, but I don't know how to call the getArray() method to actually ask for the contents of the array.
    My code is as follows:
    import java.util.Scanner;
    import java.util.ArrayList;
    public class Main
        private static Scanner input = new Scanner(System.in);
        public static void main (String args[])
            //creates ArrayList
            int List[];
            System.out.println("How long would you like the array to be?");
            int arrayLength = input.nextInt();
            //Initializes array list
            List = new int [arrayLength];
            System.out.println("Please enter the first value of the array");
        public static void getArray(int List[], int arrayLength)
            for(int i=0; i < arrayLength; i++) {
                 System.out.println("Enter the next value for array");
                 List[i] = input.nextInt();
         public static void printArray(int List[])
             for(int i=0; i < List.length; i++)
                 System.out.print(List[i] + " ");
    public class search
        public static int binarySearch(int anArray[], int first, int last, int value)
            int index;
            if(first > last) {
                index = -1;
            else {
                int mid = (first + last)/2;
                if(value == anArray[mid]) {
                    index = mid; //value found at anArray[mid]
                else if(value < anArray[mid]) {
                    //point X
                    index = binarySearch(anArray, first, mid-1, value);
                else {
                    //point Y
                    index = binarySearch(anArray, mid+1, last, value);
                } //end if
            } //end if
            return index;
        //Iterative linear search
        public int linearSearch(int a[], int valueToFind)
            //valueToFind is the number that will be found
            //The function returns the position of the value if found
            //The function returns -1 if valueToFind was not found
            for (int i=0; i<a.length; i++) {
                if (valueToFind == a) {
    return i;
    return -1;

    I made the changes. Two more questions.
    1.) Just for curiosity, how would I have referenced those methods (called them)?
    2.) How do I call the searches?
    import java.util.Scanner;
    import java.util.ArrayList;
    public class Main
        private static Scanner input = new Scanner(System.in);
        public static void main (String args[])
            //creates ArrayList
            int List[];
            System.out.println("How many values would you like the array to have?");
            int arrayLength = input.nextInt();
            //Initializes array list
            List = new int [arrayLength];
            //Collects the array information
            for(int i=0; i < arrayLength; i++) {
                 System.out.println("Enter a value for array");
                 List[i] = input.nextInt(); 
            //Prints the array
            System.out.print("Array: ");
            for(int i=0; i < List.length; i++)
                 System.out.print(List[i] + " ");
            //Asks for the value to be searched for
            System.out.println("What value would you like to search for?");
            int temp = input.nextInt();
            System.out.println(search.binarySearch()); //not working
    }

  • Why is AirDrop where Airplay used to be in the control center, and how do I get Airplay back?

    When I go into control center, Airdrop is where Airplay used to be located. How do I get AirPlay back?
    Help appreciated!!

    Read this:
    http://support.apple.com/kb/TS4215

  • How to save the difference values in cube after planning functions.

    Hi,
    Now  i am facing small problem but it is tricky..
    in BPS reading the actual value and modifying the actual value in my plan layout and storing the plan values in my transactional cube.before saving the data i am checking the difference between actual and plan value and that difference value i am saving into my cube.here i am using two planing function one is distributing the actual value into my weeks(using fox code i done)after distributing now i am using second planning function to calculate the difference values.but in my layout alwyas i have to show distribute values only.not difference values but in cube i have to save difference values how can i manage this situation.
    Thanks...

    Hi,
    Now  i am facing small problem but it is tricky..
    in BPS reading the actual value and modifying the actual value in my plan layout and storing the plan values in my transactional cube.before saving the data i am checking the difference between actual and plan value and that difference value i am saving into my cube.here i am using two planing function one is distributing the actual value into my weeks(using fox code i done)after distributing now i am using second planning function to calculate the difference values.but in my layout alwyas i have to show distribute values only.not difference values but in cube i have to save difference values how can i manage this situation.
    Thanks...

  • How to save  particular variable values for all users

    Hi Experts,
    I have variables posting period with user entry default value  and fiscal year(with entry vulaue mandataory)in 30 queries.Now user wants to set this values i.e.posting period to 0 -16 (interval) and fiscal year to 2008.
    whoever opnes the workbook he should  get the the defualt values as posting period 0-16 and fiscal
    2008 in variable selection screen.unless user enters the values it should remain same Please suggest me how to do that.Is this changes should be saved as vaintat in variable selection screen and transported or shall I do this change for all thse quesries or shall I change the variable value to default setting in variable propeties so that changes should be visible to all 30 queries .Please suggest....!!!!
    Regards
    Prasad

    Hi Prasad,
    Just go to that variables in query designer, and give the default values for the variables as 0-16 and for Fiscal year 2008.
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/ae/1e9b3c334d8c15e10000000a114084/content.htm
    Now while generating the query in the variables screen select the personalization, so that these values will be fixed and personalized for the query.
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/30ae3d47afd652e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/3f/30ae3d47afd652e10000000a114084/frameset.htm
    Rgs,
    I.R.K

  • How to save X and Y vaue from a Waveform Chart

    Hello Everyone!
    I'm implementing an adquisition systems that send data to a waveform Chart through VISA. All run properly, but I would like to save the data adquired to an excel file. I saw examples to how to save it, but only save the Y value.
    I would like getting the X and Y values in 2 columns different in the excel file.
    ¿Is it possible?
    ¿Can someone tell me how I can do it?
    Thanks for your feedbacks! 
    Solved!
    Go to Solution.

    I meant uploading the actual VI, not a picture of it. You need to fix your code.
    You should not be initializing the serial port in each iteration of the loop. Initialize outside, read in the loop, and close when the loop is done.
    Why do you have 2 VISA resource controls? Are you talking to 2 different devices?
    The event structure serves no purpose in your code. If you are trying to enable/disable the file writing, use a case structure that's controlled by a simple front panel switch.
    You should "remember" the path that the Write to Spreadsheet File uses. Otherwise you will be asked for the filename each and every time you try to save. You can do this using a simple Feedback Node:
    Since you are reading the value periodically, just use one of the Get Date/Time functions. You can use the Get Date/Time String to get a formatted string. Then you can format your value as a string, and build your array using those 2 values. Or, you can use the Get Date/Time in Seconds to get a numerical value. Be aware that LabVIEW's starting time is 12:00 a.m., Friday, January 1, 1904, Universal Time [01-01-1904 00:00:00], which is different from Excel. 
    Attachments:
    Example_VI_BD.png ‏1 KB

  • Have received a outstanding picture of the Iwo Jima Memorial in an e-mail. I want to use it as my backdrop on iPad 2. Anyone know if it is possible and how?

    Have received a outstanding picture of the Iwo Jima Memorial in an e-mail. I want to use it as my backdrop on iPad 2. Anyone know if it is possible and how?

    Save the photo from the received email - select and hold on the photo until prompted to save the photo.
    The following was copied from the iPad user guide.
    Wallpaper and Lock Screen Photos
    You can display a photo in the wallpaper background of the Lock screen and Home screen. You can choose from several wallpaper pictures included with iPad, or you can use a photo of your own.
    Set a photo as screen wallpaper:
    Choose any photo and tap          , then tap Use As Wallpaper.
    Drag to pan the photo, or pinch the photo to zoom in or out, until it looks the way you want. Keep in mind that the image will be displayed in both portrait and landscape orientations but won’t rotate.
    Tap Set Wallpaper. Then tap to use the image as wallpaper for the Home screen, on the Lock screen, or both.
    To choose from several wallpaper pictures included with iPad, go to Settings > Brightness & Wallpaper.

  • How to save HTML

    i need to know how to save an HTML file of a visited website being entered
    from a textField. I want it to be able to save the picture files as well..
    as an example when u key in http://www.yahoo.com i gets the HTML files and
    and the WHOLE image files contains in http://www.yahoo.com and save it to a certain directory. Just like when u visited a website and u click save as in IE, u can get the HTML files and all the image files from the website.
    thx..

    alright.. so this is the portion of my code.. i am suppose to download the image to a certain folder.. but so far it can only extract the HTML content to a textArea i provided. and the temp.indexOf("extension") does not work in my program.. but i works in my friends program.. pls tell me what went wrong.. and how to save the whole image files into a certain folder.
    try
    String strimg, temp;
         a=0;
         b=a+5;
                                       htmlArea.setText("");
                                       cmbimg.removeAllItems();
                                       connectionArea.append("* Processing request by "+s.getInetAddress().getHostAddress()+" to "+msg+" ......");
                                       URL url=new URL(msg); // value taken from client request
                                       BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream()));
    // this is the portion that extract the HTML files
                                       do
                                            temp=in.readLine();
                                            if (temp.indexOf("jpg")>1 || temp.indexOf("gif")>1 || temp.indexOf("JPG")>1 || temp.indexOf("GIF")>1)
                                                 //Assigning 'a' a Value.
                                                 if( temp.indexOf("src")>1 || temp.indexOf("SRC")>1 )
                                                      if( temp.indexOf("src")>1)
                                                           a=temp.indexOf("src");
                                                      else
                                                           a=temp.indexOf("SRC");
                                                 //Assigning 'b' a Value.
                                                 if ( temp.indexOf("jpg")>1 )
                                                      b=temp.indexOf("jpg");
                                                 //Assigning 'b' a Value.
                                                 else if (temp.indexOf("gif")>1)
                                                      b=temp.indexOf("gif");
                                                 //Assigning 'b' a Value.
                                                 else if ( temp.indexOf("JPG")>1 )
                                                      b=temp.indexOf("JPG");
                                                 //Assigning 'b' a Value.
                                                 else if (temp.indexOf("GIF")>1)
                                                      b=temp.indexOf("GIF");
                                                 strimg=temp.substring(a+5,b+3);
                                                 cmbimg.addItem(strimg); //cmbing is a JCombobox
                                            //EXRTRACT IMAGES FROM SITE
                                            strimg=temp.substring(a+5,b+3);
                                            cmbimg.addItem(strimg);
                                            if (temp.equals(null))
                                                 temp="";
                                            htmlArea.setText(htmlArea.getText() + "\n" + temp); //htmlArea is the text area to display the extracted HTML content
                                       }while(!temp.equals(null));
                                  catch(java.net.ConnectException eNet){
                                       System.out.println("Connection Failed....");
                                  catch(NullPointerException e){
                                  catch(MalformedURLException eNet1){
                                       connectionArea.append("\n* "+msg+" is an Invalid Address");
                                       count = 1;
                                  catch(Exception e){
                                       connectionArea.append("\n* Unable to Connect to: "+msg+"\n");
                                       count = 1;
                                  }

Maybe you are looking for

  • Multiple input arguments in User defined funcions

    Hi Experts,    I have a file to proxy sceanrio.Have to do one to one mapping of all the corresponding fields except 3 fields. for eg 1)  - <Services>           <DisplayValue>Tax>Business Tax</DisplayValue>        </Services> Sender                   

  • Problems with a query in Reports6i

    Hello, hope someone can help me with this issue. I have a query like this in my reports: select c_id ,dat_tim,glo,utr from ce_pro where c_id IN ('X1200', 'X1210') and glo not like 'null' or utr not like 'null' group by c_id, dat_tim,glo, utr having d

  • Sliders for iBook's widget built in iAd producer

    I am attempting to build a widget that features sliders (general object) for iBooks in iAd producer. I added sliders in iAd Producer; have a minimum setting of 0.0, maximum of 10, and moving at increments of 0.5. I tested them in the preview funciton

  • Clearing app cache?

    I noticed that certain apps, like Facebook, Pinterest and Instagram, are starting to hog up a bunch of memory on my device. When checking the usage details, I don't have the option to clear out the 'documents & data' within the app. I've been reading

  • Faces will not identify any faces in my iPhoto

    I have tried to use Faces and have had no luck. I have spent a great deal of time with Apple tech support and they are baffled as to why the program is not working. I have taken many pictures of myself with Photo Booth loaded them into iPhoto and tag