4,084 Posted Topics

Member Avatar for zhanrah

1. I mainly post in the Java section because I'm a Java developer and rarely use C 2. don't PM people at random to get your code fixed, just wait untill someone who can actually help you responds.

Member Avatar for Moschops
0
207
Member Avatar for branflake

nope ... very bad code, and wouldn't always work. it looks correct, but, when it looks like a duck, and it cuacks like a duck, it could (in cases like this) also be a swann. it's the 'if-expression' where you're going wrong. you're not supposed to check equality of two …

Member Avatar for stultuske
0
11K
Member Avatar for boboi haokip
Member Avatar for Pirouette

String sum = ""; if ( sum.equals("")) sum += num; else sum += " + " + num; or sum += " - " + num; and within each if where you add or subtract depending on where you are in your code

Member Avatar for zeroliken
0
4K
Member Avatar for javaNooblet

instead of [Code=Java] System.out.print(""); [/Code] use [Code=Java] System.out.println(""); [/Code] that will make your pointer go to a new line for each print if you want to go and use excell files in java, you may want to look into [URL="http://jexcelapi.sourceforge.net/"]JExcelapi[/URL] or [URL="http://poi.apache.org/"]poi[/URL], a library by apache to use ms office …

Member Avatar for stultuske
0
268
Member Avatar for shootingrubber

The problem is you have: [Code=Java] GUI go = new GUI(); [/Code] in two different places. one of them final. what you want to do is replace these instantiations by: [Code=Java] go = new GUI(); [/Code] and declare the variable go outside of the main method as a static instance …

Member Avatar for shootingrubber
0
190
Member Avatar for JRDJ12
Member Avatar for stultuske
0
201
Member Avatar for th3b3n

well ... toString returns a String method, that's ... basically why the method 's named to'String'. of course, if some 'funny dude' decided to write a toString method that returns a Double (which I doubt), it can be anything. I think this: if(listCollector[0][y] == checker[0]){ needs to be if(listCollector[x][y] == …

Member Avatar for th3b3n
0
183
Member Avatar for DaniwebOS

considering you don't have a valid main method .. how did you get it to run in the first place?

Member Avatar for Paul Norris
0
158
Member Avatar for swetha.y

ehm ... JOptionPane, Scanner, a Swing GUI, command line parameters, properties files, xml files, ... this is a bit like asking "how many different beers are there in the world?" basically, a lot, and everybody can come up with and write new ways, so it's not really possible to sum …

Member Avatar for swetha.y
0
132
Member Avatar for tusharkango

well ... no one is going to download and check all your code, post the relevant code here and we might be able to check what's missing. and no, posting your entire application is not necessary, just the relevant code/method

Member Avatar for chrischristy37
0
115
Member Avatar for yoshio5908

but why the wile loops? they're not really used, since they will never add up more than 1. just read the code and rethink what it does.

Member Avatar for leodash
0
813
Member Avatar for maverick420

I see you quoting someone, but is that your explanation or someone elses? is there still a question, or do you provide an answer? please be a bit more clear on these parts.

Member Avatar for stultuske
0
250
Member Avatar for ali11

sigh ... how many times are you going to re-post this same code with the same errors in it, ignoring the help and answers you are provided with? just check the other thread(s) in which you ask help for this code, and you'll see you should have finished your work …

Member Avatar for hfx642
0
149
Member Avatar for fmnajp

[Code=Java] textArea.append("Total minutes are: " +totalMin+"\n"); // prints out data textArea.append("Average Earnings are: " +average+"\n"); textArea.append("Minimum wage is: " +wage+"\n" ); textArea.setText(""); [/Code] what did you expect this to do? you're setting the textArea with "", meaning basicly, no text. try this: [Code=Java] String a = new String("Total minutes are: …

Member Avatar for fmnajp
0
195
Member Avatar for DK58

by this line alone: System.out.println("The incomes of families making less than 10% of the maximum are: " + '\n'); I assume you either didn't test your code, or this is not the code you ran. print the text "The incomes of families making less than 10%" before the for-loop and …

Member Avatar for DK58
0
98
Member Avatar for eddy556

[QUOTE=abhijeetdani;1692878][code] if(!hello.equals(hello))[/code] this will give you false [code] if(hello.equals(hello)) [/code] this will give you true [code] if(hello.equals(HELLO)) [/code] this will give you false [code] if(hello.equalsIgnoreCase(HELLO)) [/code] will give you true Hope this helped!!![/QUOTE] didn't help.. this thread was started (and hijacked) years ago, by people who didn't come back to …

Member Avatar for stultuske
0
760
Member Avatar for Zuni123

because you're missing a '}'? you sure are missing one at the end of the code you've posted. or maybe because you are using a non-existing daysBetween method.

Member Avatar for stultuske
0
323
Member Avatar for drameshgar1

ehm ... maybe should, but: 1. you never enter values in your classlist variable 2. [Code=Java] public String classlist(){ return classlist(); } [/Code] will indeed give you errors. remove the brackets, after all, you're not trying to return the method, but the values (you should have) stored in the classlist. …

Member Avatar for stevanity
0
228
Member Avatar for ali11

ehm .. yeah, pretty normal. you instantiate your variable 'grade' to 0, never change the value yet you do test on this value. no matter how many times you run it, grade will always be 0

Member Avatar for Rzink92
0
138
Member Avatar for mehnihma

since in an enhanced for loop, you won't automatically have the x which you use as index for score and which, I assume, link the element in score to the element in grade, what do you want it for?

Member Avatar for masijade
0
144
Member Avatar for xiangzhuang

explaining why a factor behaves in a certain way is more a question to ask a mathematician.

Member Avatar for JamesCherrill
0
429
Member Avatar for mohamed moamen

you're getting a nullpointerexception somewhere on line 20, but since there's no code on line 20... I assume there's a problem in your use of the Synthesizer class, but since I've never seen it, don't know which one.

Member Avatar for stultuske
0
105
Member Avatar for vjames
Member Avatar for vjames
0
1K
Member Avatar for jalpesh_007

mmm ... I don't really get what it is you're trying to do. if you want an action to perform on clicking a label, MouseClicked should be able to do that for you

Member Avatar for mKorbel
-1
209
Member Avatar for xiangzhuang

not to mention the fact that, in the last 24 hours alone, code snippets have been posted on this forum that could easily help you solve your problem. this is not a "code-delivery" that works 24/7, a bit effort on your part is expected.

Member Avatar for stultuske
0
140
Member Avatar for chriswinter

what are you doing this for? [Code=Java] (char)(((int)ch) [/Code] basicly, you have a char, which you transform into an integer primitive, just to transform it to a char again. not only is this completely useless, but it makes your code quite annoying to read, since just one misplaced or forgotten …

Member Avatar for hfx642
0
155
Member Avatar for javaNooblet

looks like you're having a nullpointerexception in your MainGui class, on line 35. might want to check that out. something you're missing in the constructor of SquadPanel, perhaps?

Member Avatar for stevanity
0
263
Member Avatar for pikalife

you may want to 1. check the Math class and see if there's anything in there that can help you 2. if it doesn't try to write a method yourself 3. if you can't figure out what the code should be: be a bit more clear about what you expect …

Member Avatar for hfx642
0
2K
Member Avatar for sidlampard
Member Avatar for javaNooblet

a .class file is a compiled .java file if you want to run this, you'll have to open the command prompt and go <path> java classname if on the other hand you have a java file, which is an archive executable file, you can run it by just clicking on …

Member Avatar for javaNooblet
0
258
Member Avatar for emmas4impact

can you give a bit more information before we start going through that code? what is the sound format you're trying to use?

Member Avatar for JamesCherrill
0
212
Member Avatar for lele07060

you should use a float or double for your 'i' value. you're dividing a value x by a value greater than x, which gives a result of 0.xxx, which can not be stored into a float variable

Member Avatar for stultuske
0
129
Member Avatar for akaicewolf

setVisible(false); hide(); .. there are a few methods that come in handy that you can use

Member Avatar for hfx642
0
314
Member Avatar for Daigan

you've mentioned everything you need to do. is it necessary you throw an exception, do you just have to show an error message, ... be a bit more clear, and show what you've tried so far.

Member Avatar for Daigan
0
127
Member Avatar for mehnihma

what exactly is the loop you're having trouble with, what is the input you're giving? is it giving an error message?

Member Avatar for stultuske
0
125
Member Avatar for slidepuppy1

you're continuing to run the loop after you've found it, which means you'll come into your 'else' block again. and there you overwrite the value you have stored. I think, a better way would be to run your loop, when you've found your desired index, don't store it in a …

Member Avatar for stultuske
0
168
Member Avatar for pavangajula2007

you may want to start with the sticky thread on top of this forum. it's filled with tips for starters.

Member Avatar for stultuske
0
108
Member Avatar for loupgarou

best would be to create the arrays on class level, not within a method. that way, you don't have to pass them as parameters, and still use them within several methods. do you know up front how many elements the files have? if so, instantiate the arrays when you declare …

Member Avatar for JamesCherrill
0
204
Member Avatar for Jade4127

well .. first remark: I think what you want is keeping information per instance of customer, so, I'd suggest you remove a lot of those static-keywords. static means you store the information or value for an entire class, so, if you create a second customer, you won't store a new …

Member Avatar for Jade4127
0
496
Member Avatar for Joey_Brown

the setter can always return a value, if you write it like that, but a setter is ment to 'set' data, not to 'get' it. a better way would be to throw an exception, as JeffGrigg suggests. alternatively, you could check the value of a getter , but this would …

Member Avatar for Joey_Brown
0
3K
Member Avatar for yuugib

I'm not entirely sure what you are talking about. what exactly are you stuck with, what have you done so far? as I understand it, you are having trouble to declare an array as a variable?

Member Avatar for stultuske
0
168
Member Avatar for aungmyohein

he wants to input "hello" in an jTextBox and have a jLabel show "olleh" @OP: the functionality of that method has nothing to do with how it is used, it's the same for a command line app as for a GUI app. what have you done so far?

Member Avatar for woodenduck
0
190
Member Avatar for AngelAmi

the add and addAll methods could do the trick as well, depends on how you read your data.

Member Avatar for stultuske
0
90
Member Avatar for sha11e

you can off course encrypt it, but it'll still need to be equal to the username and password of the database. you can keep the username and password in a properties file, or in an xml file, but the most secure way, I guess, is to have the user enter …

Member Avatar for ~s.o.s~
0
107
Member Avatar for kei01040
Member Avatar for KunioUnio

em ... try help you with what? ok, you've stated what you want your application to do, but you haven't told us what it does do... does it give you an error message?, does it run, but give a different output than you expect? does it fail to compile? ... …

Member Avatar for stultuske
0
274
Member Avatar for mehnihma

either that, or, if you want more control, and you don't want for all entries to take both upper and lowercase (for instance: b, B and s are valid, but S is invalid) [Code=Java] case "b": performB(); break; case "B": performB(); break; case "s": performS(); break; [/Code]

Member Avatar for mehnihma
0
153
Member Avatar for danthevan

maybe because Java programming is not your thing? and whaat exactly do you mean by: i know how to program, but I don't know how to be professional, I don't know how to practice programming?

Member Avatar for JamesCherrill
0
207
Member Avatar for sk8ergirl

question 1: what do you mean by, find mode? question 2: you enter a value, and based on that value, you can use two nested for loops: the outer one, determines the height of your pyramid the inner one, you should use to print the lines as you want them.

Member Avatar for sk8ergirl
0
347

The End.