Results 1 to 5 of 5
- 10-30-2008, 04:35 AM #1
Member
- Join Date
- Oct 2008
- Posts
- 3
- Rep Power
- 0
Help me with create a 2D Maze in Java
HI.
I am a newbie with Java. And i am doing a project by create a maze in 2D Maze.
I am confusing about writing a code for the Save and Retrieve button. (The retrieve button will load a file (type: *.maze) which is included in the zip file.)
The Retrieve and Save button will load an save the tube maze via binary files.
Anyone can help me write the code for retrieve button. (In the class: TubeSearcher). And the we can test this button by trying retrieve the sample.maze file in the zip file.
Thanks a lot
Best regards
(sorry when I not write a code here cause it's a lot of class in the zip file)Last edited by hnam31190; 10-30-2008 at 05:04 AM.
- 10-30-2008, 01:52 PM #2
YOU need to solve your problem one small step at a time. First write the save and load methods separately then write the GUI that calls those methods. What structures are you using to hold the maze in your program?
Why do you want to save the data as binary vs as text?
- 10-30-2008, 03:56 PM #3
Member
- Join Date
- Oct 2008
- Posts
- 3
- Rep Power
- 0
Well, for the binary vs text file. My project required to load and save content via binary file.
And also the structures will be using the recursion (for find the part)which I am studying now.
Thanks Norm
- 11-02-2008, 12:33 AM #4
Member
- Join Date
- Oct 2008
- Posts
- 3
- Rep Power
- 0
Can you tell me what did I do wrong here? for retrieve
Java Code:private void retrieve() { try{ JFileChooser fc = new JFileChooser();; int returnVal = fc.showOpenDialog(TubesSearcher.this); File file = fc.getSelectedFile(); if (returnVal == JFileChooser.APPROVE_OPTION) { FileReader fReader = new FileReader(file); BufferedReader reader = new BufferedReader(fReader); }//end of If } catch(java.io.IOException IOexc){ System.out.println("Cannot read from file"); } catch(java.lang.NullPointerException NPexc){ System.out.println("NullPointerException occurs"); } }
- 11-02-2008, 01:37 AM #5
Not without you telling me what the code is supposed to do and what it is doing that you don't like.Can you tell me what did I do wrong here
Do you get an error or what?
Its better to use a printStackTrace() call in caught exceptions. There is often important information included in the message showen.
Similar Threads
-
can you create a .exe with java?
By seandingobat in forum New To JavaReplies: 5Last Post: 10-21-2008, 02:35 PM -
Create GIF from JPG using Java
By trivektor in forum New To JavaReplies: 2Last Post: 10-10-2008, 02:50 AM -
Java Maze Problem
By mousey182 in forum New To JavaReplies: 2Last Post: 03-28-2008, 06:29 PM -
Maze Help
By Soda in forum Advanced JavaReplies: 1Last Post: 12-22-2007, 03:26 AM -
maze problem (file to a 2d array)
By rnavarro9 in forum New To JavaReplies: 4Last Post: 11-09-2007, 07:36 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks