Ok here is a program I am working on for an assignment. import java.io.*; public class Copy { public static void main(String[] args) throws IOException { File inputFile = new File("p1.txt"); File outputFile = new File("p2.txt"); FileReader in = new FileReader(inputFile); FileWriter out = new FileWriter(outputFile); int c; while ((c = in.read()) != -1) out.write(c); in.close(); out.close(); } } Now it works fine and everything, the problem is that I want it to print the outputFile to the screen when I run the application. And I can't figure out how! Our teacher would only say that it has something to …

Member Avatar
Member Avatar
+1 forum 5

Hello, I have been working with Java for appox the last six months but I still am very un-sure of myself. I need help figuring out how to import one Java file to the current one running. I am using Jcreator LE as a source editor/compiler and I wish to rum my program in the Console mode. Any help will be appreciated. Thank you Bob

Member Avatar
Member Avatar
+1 forum 6

/** * Compares an artist string to this CD's artist to check if the * two strings match exactly (ignoring case). * * @param otherArtist An artist's name. * @return true if otherArtist and artist variables are the same * ignoring case (String comparison). */ public boolean equalsArtist( String otherArtist ) { return false; } how do i do this i am kinda confused any help would be cool

Member Avatar
Member Avatar
+0 forum 1

Okay in case anybody was wondering I solved the class call problem. Now I am trying to create a file for Enemy characters that will store appx 100 different Enemies and depending on the level of the main character apply different stats to those enemies along with a randomly selected name, I also intend to use the basis of this code to create NPCs and shops randomly. Every shop will be filled with a number (1-10) NPCs who will be randomly selected and placed there. Included is a sample of the current enemy code I am using. I haven't set …

Member Avatar
+0 forum 0

[url]http://www.cs.toronto.edu/~gfb/csc148/2003F/a2/[/url] is it that we've to make arraylists and then link them or ceate linkedlists nad in them create arraaylist and link linkedlists. please let me know if sample code just how to get started appareciate tht thanks a lot!

Member Avatar
-1 forum 0

I'm looking for a Table of Contents JAVA script that allows 3 different images. #1 the "off" image #2 the "hover" image and #3 the "selected or clicked" image. I have script that allows me to do rollovers, I'd like to expand it so when an image is clicked on and the corrosponding web page show up an image replaces the original to indicate that the content on the screen is from the selected image. Also, if a different image is selected and it needs to have an indicator showing that its content is what is being displayed I'd like …

Member Avatar
+0 forum 0

Hi All, Can any one give me the code for closing a browser window. [code] function closewindow() { if (newwindow && !newwindow.closed) { newwindow.close() } } <input type="button" value="close" onclick="javascript: closewindow()"> [/code] this is what i have and it dont work. also, just a point, the first time i used javascript was yesterday, so please explain the obvoius as thats probably what i'm missing here. cheers spikes

Member Avatar
+0 forum 0

Hi All, i am using a combination of php and javascript on a current project, but i have got stuck. bellow is a sudo code page to try and explain what i am doing <js> function = newwindow() </js> <form> <?php echo field1> <?php echo field2> <inputtype=checkbox> onclick = submit data from selected fields and open page 2 in a target window </form> hope that makes some sence, without the html. so what i have is a form populated by php, from a database. then next to each row on the form i have a checkbox, that is linked to …

Member Avatar
+0 forum 0

Hi, I am doing Master's in Computer Science. I am trying to upload my applets made in Java 3d on web but I want all the users to see them even those who don't have Java, JRE, or plugin. Please help. Anurag

Member Avatar
Member Avatar
+0 forum 1

Hi..I've been searching all around to find out whether I could submit an entry in a JTextField by clicking a separate button created (say, a "submit" button). It seems that, the value entered in the text field will only be appended if I press the Enter key. Can someone please help? Thx!

Member Avatar
Member Avatar
+0 forum 2

Does anyone know where I can look at code for checkpinting Java applications? Any info would be very helpful. thanks.

Member Avatar
+0 forum 0

eh. Never mind...too late.

Member Avatar
Member Avatar
+0 forum 1

Hi, there! Anyone mind lighten me up on the above subject? I am currently developing a simple game in java. So I was in the process of deciding whether to use an applet or application to present it.

Member Avatar
Member Avatar
+0 forum 13

Hi. I'm in a Java class at harvard, and they gave us this assignment to create a function moveKiloMile(); , which moves an on-screen robot 1000 units. We can declare the function by using a function moveMile(); , which moves the robot 8 units. Below is the code that I wrote. I'm trying to find out how to do the kilomile function without using a loop, since the professor says that its relatively short. [code]class Mover extends UrRobot { void turnAround() { turnLeft(); turnLeft(); } void moveMile() { move(); move(); move(); move(); move(); move(); move(); move(); } void moveKiloMile() { …

Member Avatar
Member Avatar
+0 forum 11

Hi im a newbie here!I wish to build a music website based around emec'in (MC'in)!The game would b built in2 the site! There r 3 wayz MCz can battle online: 1)Vocally!(MCs rap to the music over a mic)(I dont plan on doin thiz 4 my site yet) 2)Forum(MCz post thier lyricz in a forum.Thiz iz the main way but there iz no time constrate so it givez the MC all the time in the world to write hiz lyric instead of off the top of hiz head)! 3)My way!I want a program where 2 peepz enter the room(spectators alloud 4 …

Member Avatar
Member Avatar
+0 forum 1

I have CodeWarrior v7.0, an IDE for C++ and Java. I can get the C++ functionality working, however whenever I try and begin a Java project it gives me an error saying "Couldn't generate source code because Java Virtual Machine could not be started." I've installed the latest versions of JVM, and JVM works fine for Java applications off the internet..help? =oP

Member Avatar
Member Avatar
+0 forum 3

first post! hello all. :) i'm in the process of converting some vbscript into jscript at work, and not being an expert when it comes to any sort of javascript (or c syntax generally) i am now stuck. specifically with the 'switch' statement. the application is a server-side api that returns xml based on arguments sent to it in the querystring of its url. e.g. /server_api.asp?action=getObjectByID&id=53 in vbscript i was grabbing all the arguments from the querystring and putting them into a scripting dictionary object called "qsDetail". then i was calling each like so... qsDetail("id") ...or whatever. iterating through each …

Member Avatar
Member Avatar
+0 forum 1

Hi, I was wondering how you write to an Access Database using current Java versions. I've been looking pretty hard for awhile with a teacher and some friends, but so far we haven't come up with anything. Could you guys help me out? Thx [quote] [b]Never eat soggy waffles. They Nasty![/b] [/quote]

Member Avatar
Member Avatar
+0 forum 2

I'm trying to cast an Object to a type Procedure (a class I wrote) in order to access a method in the Procedure class. Problem is, Procedure is a subclass of Object, and it requires a run-time check to verify that the object that I'm trying to cast as a Procedure object is actually a Procedure object in the first place. How do I go about implementing this run-time check? The code is an implementation of the method compareTo() in the interface Comparable. It requires that an Object be passed, so passing an actual Procedure instance is out of the …

Member Avatar
Member Avatar
+0 forum 4

IS this language suitable?

Member Avatar
Member Avatar
+0 forum 1

Hi.. can anyone pls help me to write the source code to do the calculation for this: I am writing an applet Horoscope.java that will help people to calculate the chinese horoscope by entering their year, month and day of birth. Below is the following knowledge to share: There are 12 Horoscopes and their orders are ranked as such: Rat, Ox, Tiger, Rabbit, Dragon, Snake, Horse, Goat, Monkey, Rooster, Dog and Pig. As 4th and 5th of Feb are the special days for the start of the spring that will determine your Chinese Horoscope, you need to get your birth …

Member Avatar
Member Avatar
+0 forum 1

What is the best way to do the following? : I'm writing a test program for a family of classes that simulate bank accounts, and I need the test class to take a series of characters from the command line (the letters 'c,' 's' and 'm', specifically, in any given order and in any amount) and it needs to create a bank account for each letter. Checking account for each 'c' present, Savings account for each 's,' and Money Market account for each 'm.' The creation of each type of account is not my problem. Mine is much simpler. What …

Member Avatar
Member Avatar
+0 forum 3

It seems as if the AP Computer Science course next year is to be given in Java. Since I'm not really experianced with it, and I'd like to take the class, I figured I might as well start early and learn Java now. So, first, I'm wondering what sort of java is going to be on the test? Simple text-based only? Or applets and such? Second, I'm looking out for any books or tutorial-ish things that are really worth going out and getting...any suggestions?

Member Avatar
Member Avatar
+0 forum 2

does 1 need to learn Java b4 pickup up Java 3D, or is a) Java 3D more of an IDE, or b) is it akin to Java's relationship w/Javascript - basically none?

Member Avatar
Member Avatar
+0 forum 24

In doubt if Java is capable of handling 3D environments? Check this out: http://www.brackeen.com/home/scared/ Here are more links: http://www.geocities.com/jht2k/javamazelinks.html

Member Avatar
Member Avatar
+0 forum 2

If you ever wanted to create 3d apps or 3d games, add didn't knew where to start, you will be happy to know that you can do that and a lot more with Java 3D. Java 3D API is an extenstion to the JDK, you can find info about downloading the API & it's documents , and a lot of Tutorials to get started at [url]http://www.j3d.org[/url] . Or check the sun's site at [url]http://java.sun.com[/url]. if you want to ask me a question just email me! ;D

Member Avatar
Member Avatar
+0 forum 13

Hey guys.. Whenever I click the chat for this board it starts the java applet.. and then 1-2 seconds later my computer reboots. Im using Sun JavaVM 2 v 1.3.1_01

Member Avatar
Member Avatar
+0 forum 1

Hey inscissor ever use yahoo? I'm so sick of people coming into the rooms and booting people. The safest way to be on Yahoo is through Java. Which means you logg under www.yahoo.com instead of using there HTML Messanger. Now I want pay back because they have rooms called "The Booter rooms and so on and so on. I want you to make me the coolest "Java" Booter possible. Just code that goes into Java that will overload IE. I know this sounds dumb but I want payback. I know your probadly thinking I'm crazy but maybe we can work …

Member Avatar
Member Avatar
+1 forum 4

The End.