4,084 Posted Topics
Re: a few remarks: since this is about the same application as your other thread, you may want to keep the questions in that thread. also, you are comparing values of String objects using '==' which you shouldn't do. on a few places, you already use equals(IgnoreCase) which is the correct … | |
Re: yes, that is possible. just take a look at [URL="http://www.daniweb.com/software-development/java/threads/401907"]this thread[/URL]. | |
Re: and how will you 'show' this image to your application? will it be typed, will it be read as a .jpg, will you type a 'y' or use your keyboard to create the form of a 'y' using '-', '/', ..., will you 'show' it using a webcam? | |
Re: what code? except for the toString method, there are only mock methods that are labelled as 'TODO'. what exactly do you need help with? | |
Re: ow key, I'm not entirely sure here ... is this code all within one class, are it two classes ... can you post the entire code of your application, including the complete main method? I think the problem is that you call letterGrade before test1 was assigned a value, and … | |
Re: and also, if you run it through the command line, the commands you used to compile/run your application might come in handy | |
Re: here's the answer I gave in your previous thread :) it's just a simple comparison between while and do-while. [QUOTE=stultuske;1734983] ... to answer your question about the do-while the main difference is when you run your check in the while loop, you check if the expression is valid before you … | |
Re: a and B are String objects. you never should compare equality using '==' between two objects. this will work for primitives, but for objects, you should use the equals or the equals method (or a method derived of the equals method) [Code=Java] if ( a.equals(B)) [/Code] | |
Re: I don't usually write code in the middle of the night, well ... at least not during the week for my employer, since I don't have VPN access (yet :) ) but still, I can spend days wondering over how something is supposed to be implemented, or how to solve … | |
Re: still ... as dmanw100 said: if you don't want your original array to be altered [QUOTE=dmanw100;1733894]copy that array into the result array for the function[/QUOTE] | |
Re: there I was thinking it was a mathematical operation. as for the result, nyup, * has the upper hand there, so 6+20, not that hard to figure out :) | |
Re: By using a Static Initialization Block. Just check this [URL="http://docs.oracle.com/javase/tutorial/java/javaOO/initial.html"]tutorial[/URL] | |
Re: create two arrays one containing 1, 2, 3, ... , 19 and one containing one, two, three, ..., nineteen then create the same kind of arrays, that 'll deal with the decimals: 20,30 twenty, thirty, ... do the same for hundreds and thousands and use indexes to find the correct … | |
Re: [QUOTE=Ms New to Java;1733386] String a =(String)(JOptionPane.showInputDialog(null, "Automatic Teller Machine\n [B] Balance Inquiry\n [D]Deposit\n [W] Withdrawal\n [Q] Quit\n Select you Options: ","Automatic Teller Machine",JOptionPane.PLAIN_MESSAGE)); [/QUOTE] also, you don't need this (String) cast, since showInputDialog will give you a String object as result. | |
Re: by writing a loop and adding a print statement in it: step 1: highBorder = readInHighBorder step 2: counter = 1 step 3: while ( counter < highBorder ){ squareRoot = calculateTheSquareRootOfCounter printSquareRoot cubeRoot = calculateTheCubeRootOfCounter printCubeRoot add1ToCounter } | |
| |
Re: what is it giving a nullpointer on? if it's on the dbUrl, try with ("dbURL"), since in your call you use lowercase letters, but in your xml uppercases. | |
Re: the whole JSP-servlet story is getting a bit outdated. are you planning to use JSP's with a framework (Struts, for example)? another option would be JSF, it's a newer technique then JSP. also, if you are familiar with java, you could also take a look at GWT. | |
Re: you could also have given a reference to the actual String api, giving information about that method [URL="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html"]String api[/URL] ![]() | |
Re: well ... having a positive reputation comes from people acknowledging you have knowledge enough to be considered a 'plus'. having a negative reputation can come from giving incorrect answer, spoon-feeding code, ... it's a bit logical that if the community considers you as someone who (maybe) doesn't have the knowledge, … | |
Re: [QUOTE=bderooms;1732368]Hi, If I'm not mistaking the same problem and after a while I figured out what the problem was. Basically if you use a callback voteUp.vote() than the callback it's "this" variable will be unbound. To make sure it is passed well there is a method: .bind(this) which you add … | |
Re: [QUOTE=scrappy57;1731014]if (question posted == assignment) { if( effort == 0 ) { S.O.P("U r not in the rite place"); } else { S.o.p("Explain your effort and which part in your code your are struggling with "); } } else { S.o.p("Explain your effort and which part in your code your … | |
Re: the problem isn't that it only executes once, the problem is, that when it executes, ctr = studNo.length, which means that that index doesn't exist. you're trying to access sexCode[4] while sexCode[3] is the last element. but I agree with Jeff's statement, that your if-else should either be placed within … | |
Re: [QUOTE=lethal.b;1732320]But what has got me confused is, i am reading a tutorial about threads and it says once the thread has carried out its run method the thread terminates. Does this mean the thread is killed altogether? How would i keep it alive after carry out its first task?[/QUOTE] I … | |
Re: either that, or define an id, but since you pass URL as a param to that function and don't use it otherwise, that might very well solve your problem. | |
Re: you also posted this in the JSP forum. I suggest you close this thread, since cross-posting is not appreciated. besides, since it's a servlet/JSP matter, you'll faster find people with experience at that forum. | |
Re: [URL="http://www.howtogeek.com/howto/windows-vista/using-windows-vista-compatibility-mode/"]this[/URL] is just assuming you use the latest Windows. | |
Re: first of all, SCJP doesn't exist any more :) the name changed when Oracle took Java over. AFAIK, Schildt didn't write a book that has as goal to succeed in the certification exam, so I'm not sure which one you are talking about, but when I obtained my certificate, all … | |
Re: do you give those images an id in the html? if so, you can use this id. for instance, if your images are stored with id's img001, img002, img003, ..., imgxxx you could write a script that iterates over them, and, as long as he finds the next image, write … | |
Re: if you want to use jsp's, there are different ways you can go, of which I think servlets will be the easiest to start with, this doesn't however mean it's the most efficiënt or best approach. for the moment I'm working on a GWT project (Google Web Toolkit) which uses … | |
Re: well, you don't really have a question in there, so what do you need help with? also, how far do you want your code to be able to go? just 1 + 1 or also, for instance: 1 + (2 * 3) it would also help if you add a … | |
Re: also: just speaking for my situation - the definition of 'public holiday' tends to adapt, not only where you are, but also, who you work for. so, if you want to use your application just for yourself, my suggestion would be to use an excell file, which you can change … | |
Re: read my post and the link in your other thread. seriously, it's a very bad idea to continue creating new threads | |
Re: or print the seperate values of the array. | |
Re: you may be literally new to Java, but you are also literally ignoring help that's been given in the other thread about this application. have you changed anything yet? implemented the arrays as suggested? don't start a new thread, continue in the other one with the hints you were given, … | |
Re: start a new thread, instead of reviving a dead one post your complete error message and your complete code, for I doubt this to be the line that actually causes the error. | |
Re: [Code=Java] int[] vals = new int[values.length]; [/Code] using this line, you make sure vals is as long as your values array is, but you don't know whether you'll have the same amount of elements. first: you don't need that counter variable, you don't need your constructor and you don't need … | |
Re: [QUOTE=dheaven;1731172]Perhaps you will find [URL="http://dystopiancode.blogspot.com/2011/10/useful-methods-of-string-class-in-java.html"]this tutorial[/URL] useful. It's about how to declare/use strings and the methods that the String classs has(with examples). Good luck with learning Java![/QUOTE] this 'tutorial' doesn't even show all the basic ways to initialize a String, it just shows a few of the basic functionalities that … | |
Re: have you tried to use different layouts? on the swing objects there are a lot of methods that can help you out, for instance the setBounds. but how they work will depend on wheter or not you use the right layoutmanager. | |
Re: same mistake as in your other function. you're overwriting the value, not adjusting it. | |
Re: but to keep it simple ... you're just overwriting your value each iteration, you're not adding the next lines | |
Re: other possibilities: whose machine did you write it on, are you using code/libraries from him (or another third partie), is this for your work, for a potential employer, for a course you're taking, .. ? here: "Im writing a java system for some one, and no contract has been established … ![]() | |
Re: can not find .. sounds to me like that class is not in the path of your application, or you forgot to import the class in the class where you are trying to use it. | |
Re: the best way to start is with a simple editor: notepad++ for instance. no autocomplete, so you'll learn the actual code and won't depend to hard on the IDE to do the work for you. the same goes for compiling. sure, an IDE can make compiling really easy, but that … | |
Re: what they offered you as advice ís professional advice. do you really think that if they copy paste a text you can find by google into a post here makes it more credible? no one was mocking you, but, just like your (future) employer ánd the daniweb forum rules, they … | |
Re: why are you sure this is IDE-related? maybe there is something in your code en/disabling certain items based on a condition. what you are giving us is quite a vague description, so it's hard to say what the issue might be. | |
![]() | Re: do you have <code> </code> in your file, or are they supposed to suggest code tags on this forum? does it give any result, does it give an javascript error, ... ? ![]() |
Re: well ... servlets as technology is a bit out of date, doesn't mean it's not worth looking into, if only to get the hang of the MVC pattern. A good book to consider is [URL="http://shop.oreilly.com/product/9780596516680.do"]Head First JSP & Servlets[/URL], and I think that the JSP forum in the Web development … |
The End.