Jump to content

Favorites

- - - - -

  • Please log in to reply
5 replies to this topic

#1
alone882

alone882

    Newbie

  • Members
  • Pip
  • 5 posts
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
alone882

alone882

    Newbie

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

pls, Help me

#3
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Listing the Files or Subdirectories in a Directory | Example Depot

#4
alone882

alone882

    Newbie

  • Members
  • Pip
  • 5 posts
Ok, I do it, now I wanted that will show only files names, not all directory


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 [];


}



#5
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
The file class has the 2 methods: isFile(), isDirectory()...

#6
alone882

alone882

    Newbie

  • Members
  • Pip
  • 5 posts
thank you, finally I figure out




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users