Results 1 to 3 of 3

Thread: Favorites

  1. #1
    alone882 is offline Member
    Join Date
    Jan 2011
    Posts
    4
    Rep Power
    0

    Default Favorites

    Hi,

    I`m totally newbie in JavaFX, however my teacher require me, that I create a program with JavaFX that will display Internet Explorer Favorites web pages ?

    Any Idea how can I make this program?

    Sry, for my bad english

  2. #2
    alone882 is offline Member
    Join Date
    Jan 2011
    Posts
    4
    Rep Power
    0

    Default

    Has anybody know with what command I can get all directory files names ?
    I can`t find in tutorials.

    pls, Help me

  3. #3
    alone882 is offline Member
    Join Date
    Jan 2011
    Posts
    4
    Rep Power
    0

    Default

    Ok, I do it, now I wanted that will show only files names, not all directory

    Java FX Code:
    import javafx.stage.Stage;
    
    import javafx.scene.Scene;
    import javafx.scene.paint.Stop;
    import javafx.scene.paint.Color;
    import javafx.scene.effect.DropShadow;
    import javafx.scene.paint.LinearGradient;
    import java.lang.System;
    
    import com.javafx.preview.control.TreeItem;
    import com.javafx.preview.control.TreeItemBase;
    import com.javafx.preview.control.TreeView;
    import java.io.*;
    import java.lang.String;
    
    
    
    var w = 500;
    var h = 300;
    
    var tree = TreeView {
            effect:DropShadow{offsetY:3 offsetX:3}
        root: TreeItem {
    
            def home_name = System.getProperty("user.name");
            data: new File("C:/Documents and Settings/{home_name}/Favorites")
            expanded:false
            //isLeaf: isLeaf
            createChildren: createChildren;
        }
    }
    
    
    
    function createChildren(item:TreeItemBase):TreeItemBase[] {
        def file = item.data as File;
    
        if (file.isDirectory()) {
            return for (f in file.listFiles())
            {
               
                TreeItem {
    
                    var xz = f.split("/"); // <-- this wont work
                    data: xz[1];
    
                    createChildren: createChildren;
                    //isLeaf: isLeaf;
    
                }
            }
    
        }
       
        return [];
    
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •