![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Feb 2006
Location: UK
Posts: 36
Rep Power: 0
![]() |
Reading and writing files not working under Windows (find under unix/linux)
I am making a chat program for my Uni course and apart from what seems like a bug with JEditorPane and JScrollPane (when text is entered directly from a JTextField when the EditorPane 'overflows' the scrollPane scrolls to the bottom where the latest text was entered, but when text is entereted into the JEditorPane from the network (exactly the same method is called to add the text) it doesnt scroll down and instead sits at the top :mad: )
Onto my real problem, I am using CSS (and HTML) in the JEditorPane and I use System.getProperty for "user.dir" (current working dir) and "file.separator" but it the program under Windows (XP) does not seem to be able to read (or write when i try to save the html) I know the path is correcet as I printed it out (to console) with the generated HTML and saved that as a .html file and it worked fine, it also works fine under Linux (SuSE 10.0) and Unix (SunOS 5.9) [PHP]private final static String FS = System.getProperty("file.separator"); private final static String START_HTML = "<html>" + "<LINK REL=StyleSheet HREF=\"" + "file://"+ System.getProperty("user.dir") + FS + "chat.css\" TYPE=\"text/css\"></head>"; private final static String END_HTML = "</body>";[/PHP] |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|