4,084 Posted Topics
Re: a private class? maybe for inner classes, but I definitely wouldn't recommend it otherwise :) I think you ment the access modifiers public-protected-private(-package) for the variables? | |
Re: most likely, you provided a date like "03/04/2012". so, you create an 'array' using the split method, but you don't split on "/", but on ",". since there are no ",", your entire String will be in the first element of the array, there will be no second element. as … | |
Re: have you checked the forum opf OpenClinica? they're bound to be more experienced with this kind of stuff than we are. | |
Re: well, you are making it a lot more diffult than you should. also, you should use an index as value for your loop, not the value of the elements. for the first one, the easiest way is to use the enhanced for loop: for ( char a: Letter) // btw, … | |
Re: int guess1= scan.nextInt(); while((guess1 != 0)||(!game1.gameIsComplete())){ guess1 = scan.nextInt(); that's why you have to enter two numbers as a guess. replace it by: int guess1= 1; while((guess1 != 0)||(!game1.gameIsComplete())){ guess1 = scan.nextInt(); that way, it will run the first time, since guess1 != 0, but you won't have to enter … | |
Re: I've just read this and recognized a lot of friends of mine (and, partially, myself) in it. it is true that you'll always will have to keep learning, since there will always be upgrades, new techniques, ... but the better your grasp on the basics, the easier that is. it's … | |
Re: you didn't call the methods min and max, and while you are creating an array of doubles, your methods expect an array of ints as parameters. | |
Re: most employers expect a starter to have a degree, not so that they can prove they know "the stuff", basically, they don't, couldn't and aren't really expected to, but to show they are capable of learning new things on a short time, absorbing enough information to pass the exams. but … | |
| |
Re: what do you mean by: > but my main issues arise when I try to figure out how to put that in the GUI. you can create a class Conversions with static methods, for instance: public static int getMeters(int kilom){ return kilom*1000; } while in your GUI, you call it … | |
Re: I do foresee one problem, that is that that method is able to return a null value, while the code calling it might be expecting a valid Connection. might be better to throw an Exception. also, if you're worried about having several Connections to the same DB at the same … | |
Re: get methods with huge side effects? what exactly do you mean by that? can you show us an example (doesn't have to be actual code, just an example of what you mean) | |
Re: no, you didn't instantiate aTokeniser, so your aTokeniser variable is still null. | |
Re: if (sent.charAt(count) == char 'a') this should be if (sent.charAt(count) == 'a') and ... also, you may want to print out the values at the end of your main method, to check if your counter worked as you want it to. ![]() | |
Re: well ... instantiating might not be necessary, but you can't create a method within a method. | |
Re: ignore the Glassfish server, download Tomcat, install that and set the port yourself. | |
Re: do you get an error message in your logs? what is( not) working? | |
Re: if you're writing your application in Java, I would recommend taking a look at the [JDBC Tutorial](http://docs.oracle.com/javase/tutorial/jdbc/index.html) | |
Re: what exactly do you mean by using the info out of the db? if you 're automatically going to use information stored in a table off the db, it's quite meaningless to have a login screen. | |
Re: [Code=Java] String var = "daniweb"; String val = "daniweb"; [/Code] the above will only place one String in the pool, and the other String will point to that one as well. [Code=Java] String var = "daniweb"; String val = new String("daniweb"); [/Code] since you here are explicitly saying you want … | |
Re: you mean [URL="http://en.wikipedia.org/wiki/MATLAB"]this[/URL]? | |
Re: don't hide exceptions (that is what you do here: try { Double.parseDouble(string); //Changes string to a Double super.insertString(offs, str, a); //displays it on the text field } catch(NumberFormatException e) { //if NumberFormatExcpetion what thrown do nothing } just add a e.printStackTrace(); inside that catch block tho show what happens | |
Re: well, you should keep it in a database which you have control over, and the users can't access, otherwise you would need to have the key hardcoded on the client pc, so they could easily find it by reading through the files or decompiling the code. also, you should keep … | |
Re: bit hard to do, since we don't know what level you're at, what your curriculum exists of. just java core, have you been taught Swing (NetBeans WYSIWYG or actual coding), have you been learning frameworks, ... | |
Re: is there a reason why you create a duplicate thread? so .. what does it do, what ddo you want it to do and why do you think it's not doing what you want it to do? do take notice of this: we do not have a 'World' class, so … | |
Re: add the dollar symbol? you mean a.setText(a.getText() + "$"); or something? | |
Re: as for the System.exit(0); command you tried -> this does not close the class you're working in, it stops the JVM, so everything running in it will be shut down. | |
Re: by checking your css and correcting it? or use something like a table structure or something in your html code. since we don't see any well formed code or stylesheet, bit hard to check for improvements if we can't see the current state. | |
Re: [QUOTE=slman;1783970]how can i write it in the Eclipse[/QUOTE] well ... typing your code in eclipse, rather than in a post here would be a good start. I don't really see anything wrong with your code above, so what exactly is it what you need help with? | |
Re: [Code=Java] if ( line.indexOf(theWord) != -1 ) System.out.println(line); [/Code] with line being the line of the input file and theWord being the word you're looking for. PS: never allow your main method to throw an Exception, that way you'll never be able to avoid your application to crash when there's … | |
Re: I have ... no idea whatsoever you are talking about. what do you mean by 'placed them on platforms'. also, if you've already placed them on platforms, doesn't that imply your enemy is on its own platform? please elaborate a bit more. | |
Re: what do you mean, get that value? | |
Re: your camera class does not contain an 'add' method, so that's where you're having trouble. also, wouldn't it be easier to read if you added all the 'actionPerformed' methods in one big actionPerformed, and run the code based on the component that triggered it? | |
![]() | Re: what exactly do you need? words in a sentence? isn't using the split method easier? ![]() |
Re: 1. learn how to start a new thread 2. learn about sessions and storing information in them | |
![]() | Re: [QUOTE=happygeek;1751227]I'd rather watch paint dry... ;) (runs and hides)[/QUOTE] which color paint dried first? (I'm betting blue :) ) |
![]() | |
Re: well, you have two Strings: 1. your original word 2. a String the same length as your original one filled with *'s. you print the second one. whenever you guess a char, you verify with the original String if the char is in there, and if so, check the indexes … | |
Re: you are creating methods within methods. chech your opening and closing brackets ({}) | |
Re: or, if you mean that it may only be changed if it has a certain value, for instance, it has to be a positive value: [Code=Java] public void setMark(double mark) { if ( mark >= 0) this.mark = mark; } [/Code] | |
Re: requirements for sql server 2005, check their website, there should be a nice overview of them. you don't connect it to an IDE, you just create a connection in your code. you may want to check out [URL="http://docs.oracle.com/javase/tutorial/jdbc/index.html"]jdbc[/URL]. what do you mean with: make no. of instances? | |
Re: are they in the same or in separate files? | |
Re: actually, that is half the work. allthough it's better to write it a bit like: [Code=Java] ... Integer.parseInt(((Game)theDB.get(i)).getHTScore()); [/Code] allowing your instance variables to be public accessible is a bit risky, using mutotars (setter-s / getter(s)) is a better approach. next to that, you'll need to keep a counter, that … | |
Re: you're getting a nullpointerexception in your contextInitialized method. start with a System.out.println for your arg variable, to check if that passes what you think it is passing. add to each e.printStackTrace() a precision: System.out.println("error in first catch"); e.printStackTrace(); .. System.out.println("error in second catch"); e.printStackTrace(); and you'll quickly know where the … | |
Re: most commonly used way: keep a number of Chair elements, or an int counting the number of chairs, depending on the structure of your code, as an instance variable and use either the constructor or a setter. | |
Re: you could show us how you're calling nextNumber starting from line 13 in that testclass, not really compilable, is it :) | |
Re: they are only initialized if you actually run that if block, so, they're not always initialized. | |
Re: a for instance: if you would like to work as a consultant, a lot of companies will say: fat chance. (I know the company I worked for would have) You being sent to their customer, you'll represent your company. you don't have any working experience yet, so it'll be hard … | |
Re: [URL="http://docs.oracle.com/javase/tutorial/jdbc/index.html"]jdbc[/URL] | |
Re: few remarks on that.. you'll have to "make" your DB before you'll be able to use it, so the correct answer would be 'no'. what you are looking for is more along the lines of having a centralized DB, that's not run locally on each client machine, and that can … |
The End.