3,927 Posted Topics

Member Avatar for CoolGamer48

The switch should work just fine. Make sure that your game loop is checking it appropriately and that you haven't defined the RUNNING and PAUSED constants to be the same value (by copy-paste oversight or whatever).

Member Avatar for prushik
0
363
Member Avatar for piers

Look at the api doc for indexOf(). It returns -1 when the string is not found in the target string. You are searching for a comma in a name that does not contain a comma in your driver class. The test name in your class does have the comma so …

Member Avatar for Parsu7
0
156
Member Avatar for Lioshenka

Use a [URL="http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html"]BufferedReader[/URL] with the readLine() method. You can either skip lines as you read them, or place each line into an ArrayList, and process them as needed.

Member Avatar for ~s.o.s~
0
3K
Member Avatar for mayank.aga

If you use [URL="http://java.sun.com/javase/6/docs/api/java/io/BufferedWriter.html"]BufferedWriter[/URL], which can be wrapped around a FileWriter, you can use newLine(). If you need to write the OS-specific line separator yourself, use System.getProperty("line.separator").

Member Avatar for mayank.aga
0
199
Member Avatar for Shveetis

You cannot declare methods inside other methods like that. Move it out to the class level.

Member Avatar for Shveetis
0
76
Member Avatar for conklin

[url]http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html[/url] and [url]http://java.sun.com/docs/books/tutorial/essential/environment/paths.html[/url]

Member Avatar for Ezzaral
0
64
Member Avatar for vijaysrivatsa

Well, you are asking someone to teach you how to do your project, which amounts to the exact same thing. Make some effort.

Member Avatar for Ezzaral
0
95
Member Avatar for The Dude

[QUOTE=EnderX;536199]I would think everyone would qualify as 'food-addicted'; I don't know many people who can go for very long without eating something.[/QUOTE] Yes, the withdrawal symptoms are rather severe.

Member Avatar for maravich12
1
137
Member Avatar for plgriffith

Yes, for your purposes a simple array of String would be all that was needed.[code]import java.io.*; public class Problem2 { private static BufferedReader stdin = new BufferedReader( new InputStreamReader( System.in ) ); public static void main(String[] arguments) throws IOException { System.out.println("Welcome. How many names do you wish to enter?"); String …

Member Avatar for Ezzaral
0
110
Member Avatar for petzoldt01

Hard to say really, especially not seeing your custom wrapper code. I have only used JOGL with Swing/AWT, so I'm not familiar with any of the issues related to its use with SWT, but since you say the code works fine without your abstractions I would look to those first …

Member Avatar for Ezzaral
0
175
Member Avatar for mtbutt
Member Avatar for piers
0
101
Member Avatar for alejalv

For one thing, this [code]public class Point extends Pair { super(xx,yy);[/code] is not a valid constructor. Re-examine your class notes on basic class structure.

Member Avatar for VernonDozier
0
177
Member Avatar for kishjeff

Take a look at the NeHe OpenGL tutorials found here: [url]http://nehe.gamedev.net/[/url] It should get you up to speed pretty quickly on the basics. You certainly don't need to use Linux unless you just happen to want to.

Member Avatar for rick22
0
230
Member Avatar for Grantmitch1

Read through the sticky thread at the top of this forum. There are a lot of references there. I've heard the "Head First Java" book is very good, as well as "Core Java 2 vol.1/2".

Member Avatar for majestic0110
0
90
Member Avatar for toshibata

Well, you do not call the printCapitalized() method anywhere in your main method, so it's not going to do anything until you call it.

Member Avatar for stultuske
0
104
Member Avatar for kilermage

You're also trying to declare your methods inside that incorrect constructor. You cannot declare methods within methods.

Member Avatar for stultuske
0
156
Member Avatar for CaffeineCoder

You would need to post the paintSprite() method code, as that is the one making the calls into the graphics methods that are overflowing the stack.

Member Avatar for CaffeineCoder
0
245
Member Avatar for Lardmeister
Member Avatar for Lardmeister
0
730
Member Avatar for Rasjoe

Java has an api for working with images. There is no need to read raw file values. Take a look at some of the examples here: [url]http://www.exampledepot.com/egs/java.awt.image/pkg.html[/url] Specifically you will probably want to work with a BufferedImage: [url]http://www.exampledepot.com/egs/java.awt.image/ImagePixel.html[/url]

Member Avatar for Rasjoe
0
98
Member Avatar for Koldsoul

Well, you know that the rank will be 1 or 2 characters. The suit will always be a single character at the end. Using the substring() and length() methods of String, you should be able to separate the string easily into the two portions that you need.

Member Avatar for Koldsoul
0
85
Member Avatar for The Dude

[QUOTE=Estella;519853][B]"The fear of the LORD is the beginning of knowledge: but fools despise wisdom and instruction." Proverbs 1 : 7[/B][/QUOTE] I would argue that fools mistake religion for knowledge and wisdom.

Member Avatar for twomers
4
518
Member Avatar for Danii

No, you do exactly what the assignment indicates: Use an Iterator (look it up in the API) to walk through each List element and append the String from each element's toString() value to your text area.

Member Avatar for Danii
0
113
Member Avatar for John A
Member Avatar for Dani
0
184
Member Avatar for nuch1311

You're definitely going to need to do more work on it then what you posted if you expect to receive any help at all.

Member Avatar for Ezzaral
0
111
Member Avatar for new_2_java

You could add the file names to a [URL="http://java.sun.com/javase/6/docs/api/java/util/HashSet.html"]HashSet[/URL] as you download them. The add() method will return false if the set already contains the item, at which point you could alter the filename, add it to the set and then write it to the zip stream.

Member Avatar for new_2_java
0
4K
Member Avatar for JoePie

You don't show how you are attaching the listeners, but yes, it's a focus issue. The easiest thing for you to do is define the actions for those listeners as small inner classes that extend [URL="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractAction.html"]AbstractAction[/URL]. That will allow the button and key listeners to share the code for that …

Member Avatar for JoePie
0
1K
Member Avatar for new_2_java

About the only thing that comes to mind is to use System.out.print() (not println) to print the file name and then append periods after it until it's done, and then println "complete" and move along to the next file. There isn't really a mechanism to overwrite a line of output …

Member Avatar for Ezzaral
0
264
Member Avatar for missileh

For this you would use a [URL="http://java.sun.com/javase/6/docs/api/java/lang/Process.html"]Process[/URL] which can be created via [URL="http://java.sun.com/javase/6/docs/api/java/lang/Runtime.html#exec(java.lang.String)"]Runtime.getRuntime().exec(java.lang.String)[/URL] or [URL="http://java.sun.com/javase/6/docs/api/java/lang/ProcessBuilder.html"]ProcessBuilder[/URL]. Process has methods to obtain input/output/error streams as well if needed.

Member Avatar for missileh
0
282
Member Avatar for fufu123

Well, start by writing a class that represents a gas bill I guess. You already listed two properties it should contain. Add more as needed. Beyond that, you haven't given enough information to work with.

Member Avatar for Ezzaral
0
52
Member Avatar for MxDev

It's merely a number that identifies that build (compilation) of the software. Each build incorporates one or more changes to that software and numbering them allows you to keep track of those changes incrementally and also to roll back if necessary. It's similar to a fine-grained version number in some …

Member Avatar for jwenting
0
124
Member Avatar for The Dude
Member Avatar for edchabz

[QUOTE=edchabz;532656]I have a good idea what I am supposed to put but I can't seem to get it right. I have two different files, Server.java and Client.java. I want Client.java to call a method in Server.java. This is what I have figured out so far. public class Client{ public static …

Member Avatar for edchabz
0
152
Member Avatar for Jicky

[QUOTE=vegaseat;508321]"SuPeRcAlIfRaGiLiStIcExPiAlIdOcIoUs" works well for me as a password.[/QUOTE] Not exactly what I want to have to type in the morning to unlock my workstation ;)

Member Avatar for technogeek_42
0
387
Member Avatar for Ezzaral

It's not hard to see congressional strings being pulled for this one: [url]http://arstechnica.com/news.ars/post/20080207-controversial-college-funding-bill-passedp2p-proviso-intact.html[/url] [QUOTE]COAA makes a host of changes to the higher education landscape in the US, but for our purposes, the most interesting was the requirement that schools make plans to offer some form of legal alternative to P2P …

Member Avatar for jwenting
0
164
Member Avatar for Acidburn

You might want to look into whether you can use [URL="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html"]Callable[/URL] for your task instead of Runnable. Callable throws Exception and returns a result. Using that, in conjunction with Future and an Executor perhaps, would be an option. Since you seem to have a lot of questions on threading lately, …

Member Avatar for Ezzaral
0
100
Member Avatar for Lardmeister

[QUOTE=iamthwee;528847]@Bennet: During your college years there will be no other time in your life where you will have a continuous flow of chicks. Make the most of it. Carpe Diem.[/QUOTE] It would be "Carpe dame" in that case I guess?

Member Avatar for ~s.o.s~
2
307
Member Avatar for javaStud

Of course there is an error - you haven't written the method alreadyExists() yet. That is exactly what javaAddict was trying to tell you in the first place. You can't call methods that you haven't written yet. Additionally, if you would actually read the API for HashMap, which Phaelex suggested, …

Member Avatar for javaAddict
0
232
Member Avatar for ceyesuma

Well, it took about 2 seconds to find with Google: [url]http://en.wikipedia.org/wiki/Pi#Calculating_.CF.80[/url]

Member Avatar for ceyesuma
0
1K
Member Avatar for soccerrm1

In all likelihood, yes, you'll have Java at some point in your CS courses. Visual Basic is a lot less likely.

Member Avatar for stultuske
0
111
Member Avatar for ashkash
Member Avatar for stultuske
0
245
Member Avatar for rickster11

Sure, you can use length. The parsing problem is that you are using the indexOf(",") value to start, when you should use indexOf(",")+1. You are getting the comma and it won't parse that.

Member Avatar for javaAddict
0
104
Member Avatar for piers

You cannot place those assignments ("card[0] ="SPADES Ace";") directly in the class body like that. Additionally, you are not using the template that was provided. You have declared card[] as an array of Deck, when the assignment declares deck[] an array of Card. It also indicates that in the constructor, …

Member Avatar for Ezzaral
0
157
Member Avatar for Shveetis

Try using a [URL="http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html"]BufferedReader[/URL] with the readLine() method.[code]String line=null; while ( (line=reader.readLine()) != null){ // do stuff }[/code]

Member Avatar for Phaelax
0
109
Member Avatar for fatjoy25

It doesn't show because you reset the layout on the content pane before you add the text area panel. You can't just change the layout on the container like that midway through adding components. If you need to have separately laid out sections, create panels for those sections and place …

Member Avatar for Ezzaral
0
99
Member Avatar for King_Walnut

You have leftSide() and rightSide() methods declared within the body of insertMoney(). Check your brackets.

Member Avatar for Ezzaral
0
135
Member Avatar for alejalv

Your increment statement is after the return statements. There is no way that code can be reached, which is I'm sure what the compiler is telling you.

Member Avatar for DangerDev
0
96
Member Avatar for briansmall

[QUOTE=MidiMagic;518362]No, with high taxes, you can pick only one.[/QUOTE] Ah yes, gotta find a way to get a jab in about taxes of course. :yawn:

Member Avatar for Lardmeister
0
124
Member Avatar for freddypyther

UML is great!... for selling books and useless corporate OO design seminars...

Member Avatar for jwenting
0
152
Member Avatar for MKQ
Member Avatar for Acidburn

Your intent is a little bit vague here. You need to wait for a string before actually doing anything and you also want to keep track of the time between two entries? In the first case, why not just wait for the input before starting the thread and for the …

Member Avatar for Ezzaral
0
79

The End.