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
5 replies to this topic
#1
Posted 26 January 2011 - 11:12 AM
|
|
|
#2
Posted 27 January 2011 - 12:05 AM
Has anybody know with what command I can get all directory files names ?
I can`t find in tutorials.
pls, Help me
I can`t find in tutorials.
pls, Help me
#3
Posted 27 January 2011 - 01:37 AM
#4
Posted 27 January 2011 - 08:20 AM
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
Posted 27 January 2011 - 08:21 AM
The file class has the 2 methods: isFile(), isDirectory()...
#6
Posted 27 January 2011 - 06:14 PM
thank you, finally I figure out
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









