4,084 Posted Topics

Member Avatar for GlenRogers

another possibility is by adding an implementation of the KeyListener interface to your textfield. there are several ways of doing what you're trying to do, just look at your application, whether you need it once, twice, a lot of times, in one java class, in several java classes, ...

Member Avatar for GlenRogers
0
131
Member Avatar for B204

or add a break statement once you've found the name. another possibility would be: if ( names[k] != null && names[k].equals(user)){ .... } this way you'll only call the equals on it if it isn't null, and that way, you avoid the nullpointerexception

Member Avatar for stultuske
0
205
Member Avatar for GlenRogers
Member Avatar for GlenRogers
0
112
Member Avatar for sneekula

early start: pseudo code. let them grasp the logic behind the code, and later on choose a language, and show them how to transform [Code=PseudoCode] read number set number2 to 0 do while number2 < number - print number2 - add 1 to number2 [/Code] into actual code. there are …

Member Avatar for Sanchixx
0
482
Member Avatar for apanimesh061

depends on more than just that. do you need it often? is it always the same query? do you have rights on the DB? ...

Member Avatar for ~s.o.s~
0
113
Member Avatar for naief
Member Avatar for Baduizm

the problem is, you don't have a method called 'delete' without parameters. that's why it can't find it.

Member Avatar for Mutucks
0
474
Member Avatar for rajesh_tawari

Abira: learn how to read dates (and previous posts) this is an ancient thread that shouldn't have been revived. secondly: learn how to use a search function. this question has been asked more than filosofers have debated over the "chicken - egg" problem. there have tons of suggestions been given …

Member Avatar for stultuske
0
364
Member Avatar for jalpesh_007

do you know what event throws an ArrayIndexOutOfBoundsException? let's say you have an array of ten ints: int[] row = new int[10]; the first index for this (and every other) array is 0, the highest possible(last) one is 9 (10-1) so, if you call int a = row[x]; with x …

Member Avatar for JamesCherrill
0
404
Member Avatar for trishtren

also: getoutput is not the same as getOutput java is case sensitive. you are telling your method not that you are passing a color, but you are passing the (non-existant) variable getoutput. //the add function in the pen class public int add(String c) { System.out.print(c); return 0; } why exactly …

Member Avatar for JamesCherrill
0
209
Member Avatar for sgunnery

well, if you plan to write a functional application in java, knowing how to write decent java code is a must. when you feel your knowledge of core java is sound enough to start on it, first create a decent analysis. that will tell you what object's you need to …

Member Avatar for sgunnery
0
205
Member Avatar for iEpic

> write this for me, I just have no idea where to start and need a little push into the right direction. > Thanks! are we talking html files? in that case, look for a html parser in java

Member Avatar for JamesCherrill
0
98
Member Avatar for antonis21
Member Avatar for karthikprs

first, learn the basics. an if statement is not a loop. also, be beware that anyone can lie in forms like that, so don't consider it to be "fool proof". for the rest, all the above kind off sums it up.

Member Avatar for karthikprs
0
2K
Member Avatar for raviaaaa

since a lot of companies haven't switched to 7 yet, version 6 I can understand, but as JamesCherrill says: it's risky. anyway, you may want to try the indexOf method

Member Avatar for DavidKroukamp
0
569
Member Avatar for london-G

which still doesn't make it java, this is an sql matter. > jobs (priority, date, deadline, material, status) VALUES (?, ?,?,?,? ) select customerID from Customer where CustomerID =?" seems to me you have two sql statements and try to run them as one.

Member Avatar for stultuske
0
180
Member Avatar for cvanithakpm

although most would perfer the use of mutators instead of directly trying to access (private) instance variables

Member Avatar for richieking
0
130
Member Avatar for MooGeek

for me, I'm an atheist. not that I don't approve of (some) things they do/stand for, but more like ... you will not kill, you will not steal, ... according to christianity, if you hold yourself to these 'standardized' rules, you are a good Christian. according to me, if you …

Member Avatar for Stuugie
0
356
Member Avatar for jdseader

twmgeo: this thread is four years old, and there's no use reviving it; if you want a list of books to look at, just take a look at the sticky thread on top of the java forum. as far as I understand you, you will only be using very basic …

Member Avatar for twmgeo
0
916
Member Avatar for alemojarro
Member Avatar for Valiantangel

polymorphism isn't only achieved by extending classes, but also by implementing interfaces.

Member Avatar for stultuske
0
98
Member Avatar for ShadyTyrant

if your client tells you, you're not allowed to use a certain technology, don't go all high and mighty and think: I'll write it in that langauge/framework anyway, because I can make it really good-lookin', or very professional or efficiënt. if your client tells you not to use something, they …

Member Avatar for EvolutionFallen
0
111
Member Avatar for km2011

how do you seperate your different parts? is there always a space between the 'value' and the operators or not?

Member Avatar for km2011
0
193
Member Avatar for javabegginer

well, if you let us know what errors you get now, we might be able to help easier > interestRate = keyboard.nextDouble(); I assume the above line gives you problems? you have to declare variables before using them.

Member Avatar for poojavb
0
287
Member Avatar for Valiantangel

do you havd those variables declared as instance variables? we can see you didn't declare them at the beginning of the class, but, then again, java does allow declaring them anywhere. if you haven't: this. refers to the current instance. this.first refers to the instance variable first of the current …

Member Avatar for JamesCherrill
0
212
Member Avatar for 47pirates

one mistake you are making, is that we don't see any of the relevant code, so it's impossible for us to see whether there's something 'odd' in it.

Member Avatar for 47pirates
0
427
Member Avatar for Valiantangel

it's the enhanced for loop. String[] myStrings = {"one","two","three","four"}; for ( int i = 0; i < myStrings.length; i++ ) System.out.println(myStrings[i]`); does the exact same as String[] myStrings = {"one","two","three","four"}; for ( String tempString : myStrings ) System.out.println(tempString);

Member Avatar for JamesCherrill
0
139
Member Avatar for SuperManofBC

you'll need to put your check whether or not your number is higher than the currently stored one within your while loop, or you will only check whether the last number entered is greater than 0. this is not really a java issue, as much as a logical one. write …

Member Avatar for SuperManofBC
0
137
Member Avatar for juliermills

ChrisHunter: javascript can be used for functional tasks as well, css is more style related. java and javascript may have a lot of similarities, still they are different languages. whereas you can write complete software packages using java, both in a web application as stand alone desktop application, javascript code …

Member Avatar for Akill10
0
230
Member Avatar for Jdan2388

you are comparing an array of Strings against a single String. looks like very bad coding. if(possibilities.equals(possibilities[0])){

Member Avatar for stultuske
0
234
Member Avatar for pritish.kamath
Member Avatar for neti1987

what to do? first you realize that this thread is two years old, and nobody is still following it. secondly, create a new thread in which you ask your question. there are thousands of things that can go wrong, but what it is is pretty hard to know if we …

Member Avatar for stultuske
0
243
Member Avatar for kunaldinde

besides, are we talking an actual next page, or do you mean pagination, which is another matter. try something yourself first, and be clear in formulating questions you have.

Member Avatar for stultuske
0
98
Member Avatar for Kert

> But why does printing out a3 uses toString() method from class B? it doesn't. but, you stated: a3 = b3; from that moment on, a3 actually is an instance of B, that's why it'll look for the toString method in the B class first, only if it doesn't find …

Member Avatar for delta_frost
0
118
Member Avatar for Ritesh_4
Member Avatar for Ritesh_4
0
403
Member Avatar for webecedarian

to find the best sites, best place to start looking is that new thing ... the internet. the trouble with those in bookform, is that it's a real pain trying to find a link that's not dead :P as for contents, that depends on what you're interested in. if you're …

Member Avatar for vegaseat
0
193
Member Avatar for MadJako

you set the values of those variables in try blocks, but since an exception can be thrown, it's impossible for the compiler to say whether they'll be initialized or not. he has to check for worst-case-scenario, which means, he assumes they aren't initialized. if you want to solve this, you'll …

Member Avatar for MadJako
0
616
Member Avatar for 47pirates
Member Avatar for Valiantangel

just because your code compiles, doesn't mean it makes sense. take this code, for instance (snippet of your code) if ( a[i] == true || setB.a[i] == true ) u.a[i] = true; what exactly do you hope to accomplish there? I assume you noticed this, but a is a static …

Member Avatar for JamesCherrill
0
370
Member Avatar for baseballer
Member Avatar for SuperManofBC

The reason why you get errors you don't understand, is because you didn't bother to try and understand what was going on, you just copy-pasted the codebase out of [this thread](http://www.daniweb.com/software-development/java/threads/153273/java-program-cd-player-need-some-help-please#post1812319) without knowing anything about what files the OP had on his system. you didn't even bother to rename the …

Member Avatar for stultuske
0
648
Member Avatar for enakta13

keep an int on class scope, that way the value will remain through running your method several times: just to give you an idea: int aid = 0; private void simpleNumberKeyTyped(java.awt.event.KeyEvent evt) { if ( aid != 0 ) aid *= 10; int n=0; char k=evt.getKeyChar(); if (!Character.isDigit(k) ) // …

Member Avatar for stultuske
0
181
Member Avatar for malsmit2014

big mistake, quite basic to the OOP principles. the == operator is not used to check for equality of values of Objects. if you want to check whether or not two Strings have an identical value, you need to use the .equals method. if you want to convert hiddenword to …

Member Avatar for stultuske
0
209
Member Avatar for malsmit2014

because you didn't code it to read the file. you've just set that he should get his input from that file, but you're not letting your instance of Scanner actually read the input.

Member Avatar for JamesCherrill
0
188
Member Avatar for SuperManofBC

Anand01: it's maybe a bit late for this response, but anyway: in this example it should indeed be an int, but starting from java 7 it is possible to use a String variable as value in a Switch, there's an example in the link you've posted. so it just depends …

Member Avatar for stultuske
0
216
Member Avatar for jwings

I'm not sure what it is you're trying to do, but you can always use interfaces to make it possible for your listener to 'command' your other class

Member Avatar for JamesCherrill
0
95
Member Avatar for profyou

depends on what you want to learn. for some it is easy to learn different languages, others prefer to stick to one, and become very good at that one, and using frameworks written in it. so, it's about figuring out what kind of software you want to develop, and choose …

Member Avatar for jackbauer24
0
288
Member Avatar for Rvjain99

I haven't read your entire code, but I think he means that you are overwriting (hiding) some of your class variables in smaller scopes, and updating those local variables. but since you re-declare them, the value of your class variable isn't updated when you change the local one, so when …

Member Avatar for JamesCherrill
0
221
Member Avatar for ganges

read the sticky thread on top of the java forum. it's filled with recommendations of good java books and sites.

Member Avatar for jackbauer24
0
109
Member Avatar for happygeek

[QUOTE=happygeek;1778522]I became a grandad for the fourth fine today. Gracie is beautiful. Later thus week I will find out if I am going blind in one eye and how long that process will take, and importantly if it will spread to the other eye. Final tests on Friday, in the …

Member Avatar for mike_2000_17
3
233

The End.