1,678 Posted Topics

Member Avatar for COKEDUDE

booster1 and booster2 are Objects, you can't print them out as if they are Strings. Use booster1.name and booster2.name or whatever your instance variables are that are Strings that will print nicely. OR override the Object class's toString() method, provide your own implementation, then call booster.toString() in the println.

Member Avatar for Ezzaral
0
354
Member Avatar for ZoomZoom
Member Avatar for smachee

[QUOTE]Assign various Ship, CruiseShip, and CargoShip objects to the array elements.[/QUOTE] Your program isn't correct; the teacher is trying to demonstrate a concept called Polymorphism to you. Essentially you should be creating Ships like this: [CODE]# Ship[] types = new Ship[6]; types[0] = new CargoShip(); types[1] = new CruiseShip(); types[2] …

Member Avatar for smachee
0
3K
Member Avatar for abhinavupadhyay
Member Avatar for tangieb01
Member Avatar for TheDLSyrnyk

Read the rules pertaining to "we only give homework help to those who show effort", then come back and post something that shows effort. And no, it does not matter whether this is homework or not. Everything posted here falls under that rule.

Member Avatar for javaAddict
0
134
Member Avatar for Shotty

Both pieces of code say they work above the code. Which one doesn't work? The second one? And can you please fix your bracketing, I can't tell which brackets go with what. The brackets should be aligned so that the closing bracket is in the same column as the opening …

Member Avatar for javaAddict
0
79
Member Avatar for jko2326

This is going to sound stupid but did you try to open it as plain text... like in wordpad? (Or you can do so in other editors). And what is the file extension? Like .txt for example or .java

Member Avatar for BestJewSinceJC
0
85
Member Avatar for P00dle

For specific components see here: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/index.html[/url] (for example, if you want to use a button in your app, look there to see how, or if you want to use a table, etc)

Member Avatar for jbennet
0
379
Member Avatar for gasou

Your program isn't going to work. In your method celciusToFarenheit, you tried to compare with "if degree == c". However, if you look at [URL="http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JOptionPane.html"]this link[/URL] you will see that the JOptionPane class's showInputDialog method (the one you called, where you said degree = JOptionPane.showInputDialog...) returns a [I]String[/I] which is …

Member Avatar for gasou
0
637
Member Avatar for asadc

Your error indicates that you attempted to parse an integer at line 128 of your program (which is correct: it says Integer.parseInt(input)). However, the program was unable to parse an int, because your input did not immediately contain an integer. Which means you are reading in the file incorrectly. For …

Member Avatar for asadc
0
123
Member Avatar for ShrewdSpirit
Member Avatar for Stefano Mtangoo

You should only extend a class if you need to add functionality to the class (or modify the class's functionality so that it does something different). I doubt that you need to do either of those things for JFrame, so unless you have a compelling argument, don't extend JFrame. Also, …

Member Avatar for masijade
0
123
Member Avatar for weylinthedirty

[QUOTE=weylinthedirty;1061955]I was thinking about simply adding an input box onto the JPanel Menu. That way you could type a number, select a radio button then hit submit and that same window would stay open. I couldn't figure out how to do that though. I kept getting incompatible type errors.[/QUOTE] Post …

Member Avatar for weylinthedirty
0
199
Member Avatar for flashninja

[QUOTE=Perveance;1061553]Where is class Phrases code? It will be easier for me to find your mistakes having all your project's code.[/QUOTE] Did you even look at his code? The problem is obviously with the way he is reading in the text file. @OP: Scanner's next() method reads in input between the …

Member Avatar for BestJewSinceJC
0
74
Member Avatar for hallinan

Are you trying to manually do a character by character search to match words? That is a mistake. Technically it could work but the amount of effort would be enormous and fruitless. I see that your "words" can actually be multiple words with spaces between them. My first thought is …

Member Avatar for hallinan
0
91
Member Avatar for mahela007

abstraction: a concept or idea not associated with any specific instance So in computer science, I think that abstraction deals with what something does, not with how it does it. So saying that all Cars can drive, without considering more specific details of the Car, is an abstraction. I don't …

Member Avatar for mahela007
0
84
Member Avatar for COKEDUDE

And also make sure to read about Classes in Java and Objects in Java. int, double, float, boolean, long, short, etc can not use method invocations ( like someInt.someMethod() ) because they are not class types!!!

Member Avatar for javaAddict
0
202
Member Avatar for sknake

Overall I'll just say thanks to the mods because they manage to keep a forum this large in order, while still [supposedly] managing to like the site as a member, and I know how difficult that is. My favorites are basically the mods in the Java forum, surprise surprise. And …

Member Avatar for cwarn23
1
313
Member Avatar for Stefano Mtangoo

SWT was created for faster native widgets - it is faster because it uses the OS's native tools to draw the widgets, essentially. However, Swing should be plenty fast for most any purposes, and I personally prefer it. I also think Swing looks nicer. P.S. I used SWT at my …

Member Avatar for Stefano Mtangoo
1
179
Member Avatar for Phil++

Get help from a professional, in person, with your write up. Here are some tips since I've been through similar processes myself, but I'm not a professional at this, nor are most anyone on daniweb. And if you don't get help from a professional, at least get help from someone …

Member Avatar for BestJewSinceJC
0
164
Member Avatar for noktasizvirgul

So. . are you [I]simulating[/I] this process by creating threads on your local machine? Or are you actually using multiple machines and communicating with some master-server that acts to combine the results and to spawn the processes on the other machines? My reply assumes you're simulating it, and only using …

Member Avatar for noktasizvirgul
0
579
Member Avatar for Ancient Dragon

[QUOTE=eggmatters;1035630] Time it takes my Linux box to load on startup: ~45 seconds to one minute (and it has issues) [/QUOTE] Are we comparing things that depend on your hardware's speed now? In that case my dell running on Vista loads in less than that. I'll be back online shortly, …

Member Avatar for vegaseat
1
426
Member Avatar for jephthah
Member Avatar for llemes4011

It sounds more logical the way you have it - for example, to have the game class keep a list of what Objects are currently showing on screen, then when the player wants to attack, you can call getClosestObject() or something of that nature to decide how the a button …

Member Avatar for llemes4011
1
81
Member Avatar for Chillawowa

No, I don't think there are non-trivial ways to do it with a standard grading system, other than the obvious ways which have been listed in this thread already. I don't understand the system you listed, but consider that since 90 and 100 are both usually considered A's, you can't …

Member Avatar for BestJewSinceJC
0
129
Member Avatar for caperjack
Member Avatar for caperjack
0
155
Member Avatar for NicAx64

I hope your existence on this site is a joke. And obviously the U.S. government is hiding secrets, as is every other government in the world, just nothing like the crazy crap you are talking about.

Member Avatar for MosaicFuneral
-3
386
Member Avatar for cakka
Member Avatar for zortec
0
332
Member Avatar for ggeoff

I actually PMed Dani with this same question a few weeks ago, but I received no response. I didn't want to post it on the forums though. If you guys want to get a one time donation system set up, let me know when I don't have to go out …

Member Avatar for Dani
0
231
Member Avatar for ifezuec

[url]www.eclipse.org[/url] [url]www.netbeans.org[/url] (or is it com?) google

Member Avatar for Ezzaral
0
115
Member Avatar for SteveTheRed

Your LoadStudents method doesn't make sense to me. You said while(s.hasNextLine()) but you never read anything in, so I'd think that would be an infinite loop. Additionally, you kept adding a new Student with the argument 'tempPerson', but tempPerson doesn't seem to be changed anywhere. You'll need to post more …

Member Avatar for SteveTheRed
0
1K
Member Avatar for kolibrizas

The StringTokenizer class documentation says its use is discouraged in new code and to use String class's split method instead. And you cannot cause a String to be evaluated as if it was a piece of programmer written code. Instead, you could use if statements, for example "if a + …

Member Avatar for masijade
0
93
Member Avatar for lithium002

If you have a file full of ints then you would just use [CODE]while(scanner.hasNextInt())[/CODE] You would not use scanner.hasNext() and then the if statement, that is an extra unnecessary step. You could try something like [CODE] System.out.println("Enter an int"); while(scanner.hasNextInt()){ int i = scanner.nextInt(); System.out.println("Enter an int"); }[/CODE]

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for bruceaj

There is no reason you'd ever pass "this" as an argument. "this" just refers to the Object of the classtype that you are currently in. So if your class name is Car, and you say "this." anywhere within a method (other than main) in the Car class, then "this." refers …

Member Avatar for bruceaj
0
67
Member Avatar for BestJewSinceJC

Actually, at the risk of sounding whiny, I retract my statement. But I still believe that new members misuse the down vote system to "spite vote"

Member Avatar for BestJewSinceJC
1
182
Member Avatar for d7o0om

abccba if you add each letter in order to the stack and the queue, here is the final stack and queue (in the order they would be popped off) 1. abccba 2. abccba But looking at something random that isn't a palindrome: abc 1. cba (stack) 2. abc (queue) So …

Member Avatar for Ezzaral
1
354
Member Avatar for Bob_180_Bob

If you have purchased a version of Windows, if you then use a different, even stolen version of Windows but can prove that you purchased it previously. . it is still illegal, but highly unlikely that you would ever be prosecuted for it. The same as if you bought a …

Member Avatar for kaninelupus
-2
161
Member Avatar for Bluesilver

I haven't worked with Applets, but I think they work the same way as Swing basically? (Edit: confirmed - one whole point of JApplet is that it works with Swing). Use a JPanel or whatever the standard applet window is called, make the layout a GridLayout(x, y) where x and …

Member Avatar for BestJewSinceJC
0
101
Member Avatar for Ancient Dragon

That drunk guy video is unbelievable. I've been around my fair share of drunks, but nothing remotely close to that. It looks like a supernatural power is controlling him with a will to get beer.

Member Avatar for bobfromphilly
6
200
Member Avatar for mahgobb

I read occasionally. Authors I like include: David Baldacci, John Grisham, Brian Jacques, J.K. Rowling.

Member Avatar for richman0829
2
203
Member Avatar for GrimJack
Member Avatar for GrimJack
1
241
Member Avatar for Sandar Khin

Post your relevant code and tell us what part you're having trouble with. If your problem is not knowing enough about Timer and Threads, then read google. We'll be happy to help you with specific problems, however.

Member Avatar for Sandar Khin
0
96
Member Avatar for adcodingmaster

Check is extremely simple actually. If any piece can currently move to the king's position, then the king is in check. Since you already have to implement the ability to allow players to move any given piece to any square (that their piece can move to), deciding if those pieces …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for BestJewSinceJC

Is it true that code tags now "know" what forum they're in? Because I was only posting one line of code so I didn't use the =Java tag in the Java forum, yet it got posted with the Java code tags instead of the regular code tags. If that is …

Member Avatar for cwarn23
0
392
Member Avatar for Gatayo
Re: QA

My question for him is why he couldn't at least thinly veil the obvious COTS "my professor wrote this and then I pasted it on daniweb"... question

Member Avatar for BestJewSinceJC
-1
99
Member Avatar for COKEDUDE

What is a consolidated account? Just an account under both names? What do you have to do to 'make an account consolidated'?

Member Avatar for COKEDUDE
0
116
Member Avatar for Samyx

What is subpanel? Up till line 9 your code seems ok to me, after that I have no idea what you are trying to do.

Member Avatar for BestJewSinceJC
0
80
Member Avatar for ejiroy

The last part is definitely wrong. digit % 10, if digit = 245, will be 5. But digit never gets modified there, so your program will run forever. What you should be doing is using a combination of % and / .

Member Avatar for BestJewSinceJC
0
75
Member Avatar for bgirltkc

A text based table? Or a GUI table? For the first use System.out.println() in a for loop to print your items to the screen, for the second, you can use a JTable and there are tutorials for that on google. In either case, if you are new to Java, you …

Member Avatar for BestJewSinceJC
0
70

The End.