3,927 Posted Topics

Member Avatar for nekt

Well, apparently whoever wrote those methods are using that class as a key or with reflection. I don't see how you expect anyone to know the "why" details of someone else's code based upon a method signature.

Member Avatar for nekt
0
86
Member Avatar for Gage84

Well, the error message says why. Did you read it? It also indicates the line on which the error occurred.

Member Avatar for Ezzaral
0
86
Member Avatar for jpp10

Arrays are zero based, so for 'n' elements, you have index values 0 to n-1. Therefore, this loop[code]for (i=1;i<=n;i++)[/code]will skip the first element and run to n, which is past the end of the array. You need to loop[code]for (i=0;i<n;i++)[/code]

Member Avatar for jpp10
0
109
Member Avatar for barbz

I'm not going to count each line to find line 45, but it's most likely your first access of the "transition" array in Thread1. "(cnt*(cnt-1)/2)" is most likely coming up zero and leaving you with zero-length arrays.

Member Avatar for barbz
0
464
Member Avatar for spanker1

>and i dont mind if u can give me the whole code for this program So, actually you are perfectly ok with cheating, even though you claim you don't want to. Read your class notes, get a program outline or at least a decent amount of pseudo code together on …

Member Avatar for stultuske
0
126
Member Avatar for The Dude

It was a conspiracy by the folks who make plastic tamper-proof seals :P

Member Avatar for GrimJack
0
183
Member Avatar for javaman2

[QUOTE=javaman2;801609]forget it i found it out thanks for nothing[/QUOTE] With posts like this, "nothing" is pretty much what you are likely to get in the future as well.

Member Avatar for Ezzaral
0
101
Member Avatar for tmoney7566

Take a look at the constructor you wrote for Rectangle and compare that to the code you are using to create it (which you are doing when you add the "new" keyword). You have collected the info to use that constructor, you just aren't doing so.

Member Avatar for Ezzaral
0
125
Member Avatar for trelek2

Well, the first thing you need to fix is your paintComponent() method. If you override that method, you cannot arbitrarily change its signature. It must match the original method, which this does not[code] public void paintComponent(Graphics a,Graphics g){[/code]It should be[code] public void paintComponent(Graphics g){[/code]The method you have written is not …

Member Avatar for Ezzaral
0
133
Member Avatar for vasunttfshimoga

The reason is [URL="http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html"]The Java Language Specification[/URL] - that is just how it is.

Member Avatar for stultuske
0
121
Member Avatar for sweetsilverrain

When you try to call "drawCircle" where? Because in your code above, you don't have any call to that method, nor do you create an instance of your Circle class. You certainly don't want this in your Circle class constructor[code]Circle circle = new Circle();[/code]because it's going to call itself recursively …

Member Avatar for sweetsilverrain
0
225
Member Avatar for alkeshtech

Start with this: [url]http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html[/url] If you have specific questions, post back with them.

Member Avatar for Ezzaral
0
58
Member Avatar for transplantedNYr

Start with this: [url]http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html[/url] That will tell you what you need to know to compile and run from a command window.

Member Avatar for ~s.o.s~
0
251
Member Avatar for GrimJack
Member Avatar for GrimJack
0
66
Member Avatar for SimonHughes

He is referring to the "Read Me:" posts at the top of this forum: [url]http://www.daniweb.com/forums/forum64.html[/url]

Member Avatar for Suspishio
0
255
Member Avatar for Laidler

Are your class files in a different folder than your source files? Do the file names match the class names?

Member Avatar for Laidler
0
125
Member Avatar for BestJewSinceJC

There are a couple of different ways you can do it. Either of the provided Timer classes can be used to schedule a repeated task to update your internal variables (i.e. seconds). You can read about [URL="http://java.sun.com/products/jfc/tsc/articles/timer/"]when to use which here[/URL]. Alternately, you could have a simple thread running a …

Member Avatar for Ezzaral
0
124
Member Avatar for The Dude

1. Nontheist (100%) 2. Secular Humanism (100%) Not a very difficult call for their quiz to make.

Member Avatar for Ezzaral
0
94
Member Avatar for jls7168

Well, I guess that would depend on what it's "refreshing" wouldn't it? Start with this tutorial: [url]http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html[/url]

Member Avatar for jls7168
0
168
Member Avatar for Nollyvenon

[QUOTE=Nollyvenon;797623]how do i create java code that randomly assign numbers to letters,[/QUOTE]With [URL="http://java.sun.com/javase/6/docs/api/java/util/Random.html"]Random[/URL] and a [URL="http://java.sun.com/javase/6/docs/api/java/util/HashMap.html"]HashMap[/URL] I suppose. [QUOTE=Nollyvenon;797623]sum them,[/QUOTE]"+" operator. [QUOTE=Nollyvenon;797623]display them[/QUOTE] A console or a [URL="http://java.sun.com/docs/books/tutorial/uiswing/index.html"]Swing GUI[/URL] [QUOTE=Nollyvenon;797623]and store them in a database[/QUOTE] [URL="http://java.sun.com/docs/books/tutorial/jdbc/index.html"]JDBC[/URL]

Member Avatar for Ezzaral
0
96
Member Avatar for easouza
Member Avatar for Ezzaral
0
110
Member Avatar for neighbordave

What errors? You didn't specify what they are. Have you read the stack trace of the error? It indicates the nature of the problem and the line number.

Member Avatar for Ezzaral
0
233
Member Avatar for jdbarry

Well, you definitely need to replace all of those print statements with a loop that prints each line item from the array. There is absolutely no reason to type all of that in manually - it only differs by the array index. I'd recommend writing a small data class (a …

Member Avatar for VernonDozier
0
152
Member Avatar for k2k

One thing to note on the do-while loop verruckt24 posted above: You probably want a normal while() loop there instead of the do-while(), otherwise you're performing the loop code before checking the user's response.

Member Avatar for ddanbe
0
721
Member Avatar for Grub

That's because you aren't repainting the background rectangle before you paint the oval. Even so, you really should do your custom painting on a lightweight component such as a JPanel or small JComponent class that overrides paintComponent(), rather then painting directly on the JFrame. Here is your code with a …

Member Avatar for Grub
0
152
Member Avatar for tavy88

They will start you with the most entry-level tasks they can find. That may be fixing a few simple bugs in certain packages, adding a trivial feature to an existing code section, or anything else that lets you get acquainted with the code base and style with minimal interference to …

Member Avatar for tavy88
0
102
Member Avatar for chetan_8187

First thing, use [noparse][code] [/code][/noparse] tags around any code that you post. No one wants to try to read that huge unformatted wall of text you just dumped on the page. Second, [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] Lastly, how do you intend to specify the frame you want to grab? Your question is extremely …

Member Avatar for chetan_8187
0
512
Member Avatar for Alishaikh

Oh, I think it's printing the cart just fine. The problem is that your menu choice handler creates a new cart every time it's called.

Member Avatar for Alishaikh
0
116
Member Avatar for tmoney7566

>When I run my program I input 1 sales figure and the program goes into a never ending loop. Why? Because you never change this condition[code]while (dollars > 0) {[/code] >and where are all the tallies "*" beside my references coming from and why They are coming from your loop …

Member Avatar for Ezzaral
0
176
Member Avatar for stephenpeter

And stephenpeter, don't shout your questions in all caps. It's rude.

Member Avatar for jbennet
0
93
Member Avatar for Y2K_MASTER
Member Avatar for Y2K_MASTER
0
144
Member Avatar for tmoney7566

First, use [noparse][code] [/code][/noparse] tags around your code so it remains readable. Second, get the "double" out of that expression you posted the error on (line 30). It doesn't belong in there. Lastly, I don't think [icode]input.next.Int()[/icode] is a valid method on the the Scanner class. Check the API.

Member Avatar for stultuske
0
133
Member Avatar for rayda

Well, you're going to need a variable to keep track of the largest number entered so far. If you think about it a minute, updating that variable should be pretty easy in your input loop. On a side note, never throw exceptions from main(). Use a try-catch block. Also, use …

Member Avatar for stultuske
0
358
Member Avatar for k2k

The [URL="http://java.sun.com/javase/6/docs/technotes/guides/collections/index.html"]Collections Framework[/URL] has implementations of many such data structures. You only have to write your own if you need functionality that is not available with the existing ones - and even then you can probably just use composition to delegate most of the work to an existing implementation and …

Member Avatar for javaAddict
0
115
Member Avatar for stephen84s

[QUOTE=stephen84s;793482]And what would you do after you find "that" partner you are looking for ?[/QUOTE] [URL="http://www.southparkstudios.com/clips/153471"]Professor Chaos is born...[/URL]

Member Avatar for Ezzaral
0
130
Member Avatar for Young Teck 06

[QUOTE=GEVIII;791504]I Have That Same Problem........Will somebody please help!!!!!!!!!!!![/QUOTE] That's not enough exclamation points to bring the posters back from 2004.

Member Avatar for Ezzaral
0
365
Member Avatar for jdbarry

Take a look at the [URL="http://java.sun.com/javase/6/docs/api/java/lang/String.html#split(java.lang.String)"]String.split()[/URL] method. Scanner would work for that as well.

Member Avatar for Ezzaral
0
97
Member Avatar for jdbarry

Ok, there are actually two issues on that line. Your "index" variable is declared as double but used as an integer index to your array. It should be declared int. Secondly, inFile.next() returns a String. You cannot directly store that into an array of double.

Member Avatar for Ezzaral
0
99
Member Avatar for AllenB

You're getting the null pointer because you have declared the "db" variable, but you have not initialized it in main().

Member Avatar for Ezzaral
0
2K
Member Avatar for cicigirl04

Don't declare variables with the same names as methods and if you want to share those arrays between methods, you'll need to declare them at the class level. Currently they are local to your methods and are not visible to any code outside those methods.

Member Avatar for arseniew
0
493
Member Avatar for kos88

Edit your post and use [noparse][code] [/code][/noparse] tags around your code. Reading that unformatted wall of text will turn many away.

Member Avatar for Kabbelabb
0
186
Member Avatar for Rashakil Fol

Mostly because there is nothing up the call stack to deal with it. I guess it's just a pet peeve when I see that because too often you see students writing their entire program in main() and slapping a throws clause up there without even really knowing what it does …

Member Avatar for ~s.o.s~
0
151
Member Avatar for w32.sysfile

Perhaps the following will help: [url]http://www.exampledepot.com/egs/javax.swing.text/style_HiliteWords2.html[/url]

Member Avatar for zawert
0
130
Member Avatar for kateblossom

Well, the first place to start would be here at the tutorial on networking: [url]http://java.sun.com/docs/books/tutorial/networking/index.html[/url] As a basic outline, you would need to maintain a collection of URLs to visit, connect to each URL and retrieve the content, parse the content and store what you want in the database, then …

Member Avatar for sciwizeh
0
510
Member Avatar for janda5
Member Avatar for Ezzaral
0
108
Member Avatar for curtissumpter

The problem is that you have overridden the complete painting behavior of the JFrame (and the components within it) by replacing its paint() method. At the very least, you would want to place a call to [ICODE]super.paint(g);[/ICODE] before your own code. A better solution would be to add a small …

Member Avatar for Ezzaral
0
997
Member Avatar for PRASENJITBISWAS

[QUOTE=PRASENJITBISWAS;779483]Hi Am a student of BCA. Can you help me to learn about Hacking.[/QUOTE] Fail.

Member Avatar for Ancient Dragon
-2
80
Member Avatar for CcXD

If you can't keep track of 6 or 12 cokes and your own rate of consumption well enough to tell if someone's stealing them, you certainly aren't smart enough to figure out an algorithm for it. You probably aren't even smart enough to be working there at all.

Member Avatar for Ash Abe Add
0
185
Member Avatar for The Dude

Only 40% - a poor test. I've been into metal for over 20 years :P [QUOTE]ride the lightning master of puppets (close second) and justice for all theblack album otherwise known as "metallica" (this ranking will undoubtably lead to flamewars) kill em all load/reload ( crap) st. anger (total and …

Member Avatar for jbennet
0
299
Member Avatar for Blondeamon

I seriously doubt you are going to get anyone to fill in the blanks for you on this. It sounds too much like a [I]current[/I] quiz and that won't fly well here. Perhaps you should ask specific question about portion that you do not understand or fill in what you …

Member Avatar for darkagn
0
125

The End.