Forum: Java Dec 9th, 2008 |
| Replies: 5 Views: 594 it works with 1 part, but when i put it into an arraylist, it wont compile
for (int i = 0; i<FileList.size(); i++)
{
... |
Forum: Java Dec 9th, 2008 |
| Replies: 5 Views: 594 String.split(" ") doesnt work. what would the syntax for the tab deliminater be? |
Forum: Java Dec 9th, 2008 |
| Replies: 5 Views: 594 I have a tab delimilated txt file. how can i read only the second part of the file. ex
10.0.0.0 hostname date
i want to read in the hostname only
what function can i use to do this? |
Forum: Java Dec 6th, 2008 |
| Replies: 5 Views: 1,743 Runtime() has private access in java.lang.Runtime
Runtime r = new Runtime();
why am i getting this error? |
Forum: Java Dec 5th, 2008 |
| Replies: 5 Views: 1,743 I am trying to write a program that will monitor my routers and servers and notify me when they go down. I am looking for a way to ping the host and read the reply. The InetAddress.isReachable... |
Forum: Java Nov 18th, 2008 |
| Replies: 9 Views: 1,786 i read it again and i still understand the same thing.
i obiously dont understand how to use it.
can you help me out or not. |
Forum: Java Nov 18th, 2008 |
| Replies: 9 Views: 1,786 yes and according to the instructions that is how u should use it. |
Forum: Java Nov 18th, 2008 |
| Replies: 9 Views: 1,786 array is an arraylist<string>
for (int i = 0; i<array.size(); i++)
{
System.out.println(array.get(i).split(" "));
} |
Forum: Java Nov 18th, 2008 |
| Replies: 9 Views: 1,786 the file is tab separated into three sections.
section1 section2 section3
i only want to read section2 |
Forum: Java Nov 18th, 2008 |
| Replies: 9 Views: 1,786 I have a file that is tab separated. i read it in as an arraylist<string> how can i print out only the second section of the file? |
Forum: Java Nov 15th, 2008 |
| Replies: 1 Views: 380 i have a 2d array. i know the position. how can i print it out.
i just need to print out 1 single element not the entire array. |
Forum: Java Nov 15th, 2008 |
| Replies: 1 Views: 1,155 I have a 2d char array and i need to find the position of a specific char in the array. what method can i use.
return Arrays.binarySearch(this.matrixCopy, "S");
does not work it keeps... |
Forum: Java Nov 13th, 2008 |
| Replies: 3 Views: 359 so what function can i use to read in a single char at a time? |
Forum: Java Nov 13th, 2008 |
| Replies: 3 Views: 359 What is wrong with this code. when it do system.out.println(matrix[0][0] i should get 1 char i get the entire line.
int r =Integer.parseInt(line.substring(0));
int c = 10;
... |
Forum: Java Nov 13th, 2008 |
| Replies: 3 Views: 348 i have a file with 2 int's i need to assign them to a variables. the int's are separeated by a space. what method can i use to read each int separeate and then assign it to a variable. |
Forum: Java Nov 12th, 2008 |
| Replies: 8 Views: 439 got it working now, but it is printing out the wrong thing.
private void printFile()
{
for(int i=0; i<matrix.size(); i++)
{
... |
Forum: Java Nov 12th, 2008 |
| Replies: 8 Views: 439 line is getting a value, but for some reason matrix is not being populated. "i" always stays at 0. and there is info on the file it is reading from |
Forum: Java Nov 12th, 2008 |
| Replies: 8 Views: 439 this is what im getting when i compile:
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at... |
Forum: Java Nov 12th, 2008 |
| Replies: 8 Views: 439 i tried the scanner thing and nothing.
String fName = "c:\\game.txt";
ArrayList<ArrayList<String>> matrix = new ArrayList<ArrayList<String>>();
private void... |
Forum: Java Nov 12th, 2008 |
| Replies: 8 Views: 439 what is wrong with this code. it does not read the input file correctly.
[/code]
private void readFile()
{
String fName = "c:\\game.txt";
ArrayList<ArrayList<String>> matrix = new... |
Forum: Java Nov 11th, 2008 |
| Replies: 8 Views: 1,231 [/code]
String data;
String[][] matrix = new String[4][4];
private void readFile()
{
try
{
Scanner s = new Scanner(this.fname); |
Forum: Java Nov 11th, 2008 |
| Replies: 8 Views: 1,231 changed matrix and next to string. now it compiles but when i try running it goes into an endless loop? |
Forum: Java Nov 11th, 2008 |
| Replies: 8 Views: 1,231 why wont this work? i have a txt file that i need to read into a matrix. i want to read into a char array so i can analyze each char separate.
[/code]
String fname = "c:\\game.txt";
char[][]... |
Forum: Java Nov 11th, 2008 |
| Replies: 3 Views: 2,105 i eventually want to read the file into a 2d array. i want to be able to find a particular character in the matrix. |
Forum: Java Nov 11th, 2008 |
| Replies: 3 Views: 2,105 How do i read a txt file into a char array. what i have so far only give me blank lines
[/code]
String fname = "c:\\game.txt";
char data;
int row = 2;
int col = 4;
... |
Forum: Java Oct 30th, 2008 |
| Replies: 26 Views: 1,489 on the above code i got the following output:
File: pathcanonical path: c:\testing.txt can write:false can readfalse |
Forum: Java Oct 29th, 2008 |
| Replies: 26 Views: 1,489 yes ur code works, but i already have a predefined list of files. i am not creating the files. the files are already there. |
Forum: Java Oct 29th, 2008 |
| Replies: 26 Views: 1,489 yes i have permission. it shouldnt matter,but i create blank files just for testing to make sure it actually deletes.
i am using XP pro SP3 |
Forum: Java Oct 29th, 2008 |
| Replies: 26 Views: 1,489 in fileDelete()
inside the for loop after the File f statement i also have:
f.delte(); |
Forum: Java Oct 29th, 2008 |
| Replies: 26 Views: 1,489 complete code
private ArrayList<String> Files2Delete = new ArrayList<String>();
private String fName = "c:\\TestFile.txt";
public Files()
{
this.fileCollection();
... |
Forum: Java Oct 29th, 2008 |
| Replies: 26 Views: 1,489 it shows the files in the arraylist
c:\testing.txt
c:\whatever\testing2.txt
c:\something\else\testing3.txt |
Forum: Java Oct 29th, 2008 |
| Replies: 26 Views: 1,489 i am adding a list of files like
c:\testing.txt
c:\whatever\testing2.txt
c:\something\else\testing3.txt
and so forth. |
Forum: Java Oct 29th, 2008 |
| Replies: 26 Views: 1,489 they are files no directories. just a list of files. |
Forum: Java Oct 29th, 2008 |
| Replies: 26 Views: 1,489 yes i already tried that, but my question is would the code work. i usually program with c# not java. so is my code above fine. basically does f.delete() is that the correct funtion to delete... |
Forum: Java Oct 29th, 2008 |
| Replies: 26 Views: 1,489 Why wont this delete the files in the arraylist. i checked the arraylist and the files are there. i even added a "\\" to the files and still nothing. i dont get any errors.
private void... |
Forum: Java Oct 28th, 2008 |
| Replies: 1 Views: 361 What is wrong with my code. it poulates the arraylist with only the filename "c:\testfile.txt" i need it to populate it with the contents of the file.
private ArrayList<String> Files2Delete =... |
Forum: Java Oct 21st, 2008 |
| Replies: 2 Views: 343 for some reason my code is not going into the for loop. i completely skips it. any ideas??
private ArrayList<Investment> investments = new ArrayList<Investment>();
public String... |
Forum: Java Sep 14th, 2008 |
| Replies: 8 Views: 707 but i still dont have a return statement!!. how do i add it. I need to return yesterdays date?? |
Forum: Java Sep 14th, 2008 |
| Replies: 8 Views: 707 I am new to programing. i know how to return a date
public Date yesterday()
{
if(this.day == 1)
{
if(this.Check("Mar", this.month))
{ |
Forum: Java Sep 7th, 2008 |
| Replies: 15 Views: 1,567 i got it to work, but it only works 8 now = 0, but i want 9 to =1 and 10 to = 2 and so forth. so basically i want the array to go in a loop. |