4,084 Posted Topics
Re: have you already solved it? if not, why did you mark it solved? I assume you know how to get the contents from the JList, so your problem must lie in the writing to the txt file part. [this](http://docs.oracle.com/javase/tutorial/essential/io/) is a good place to start reading up on that. | |
Re: abeer_araji: that is not a Java problem, that is an assignment. the problem I see is that you didn't even try to write the code yourself. now, looks like hakeemtunde wants to help you cheat your way through school. just a few remarks about it: 1. you won't learn squat … | |
Re: now I don't follow .... what does an applet need a main method for? anyway, stop what you're doing, because you are heading in the wrong direction. class RunDemo{ void getParam(Run.x) { //Do Something.......... } } this is not correct. either you know up front that it will always use … | |
Re: actually: having a head with a working brain in it is sufficient. a lot of courses start of with a part theoretic knowledge: 1. OOP 2. syntax 3. some basics and when they come to actual programming, they start of with: "take a piece of paper and a pen and … | |
Re: downloadMethod(){ ifNotFileExist(){ createExcellFile(); } // perform actual download } | |
Re: your question makes little to no sense. either you don't need the jcombobox, and should just remove it, or you need them both. at that point there are two options: 1. they are on different components, so, you'll just navigate from one frame (or panel) to another 2. they are … | |
Re: Hi Sravani Kunam, welcome to daniweb. a few do's and don'ts, though: DON't hijack dead threads DO create your own thread for your questions DON't copy paste your assignment here, expecting us to deliver custom made code DO show some effort. what have you got so far and what are … | |
Re: also realize: Swing is not a "package" it's a FrameWork. but, one good advice, if you truly want to learn Swing development: do NOT use any code generators or UI builders like the one NetBeans offers (even if it is shown in the official tutorials of Oracle). writing a decent … | |
Re: even better yet, do NOT go to http://www.tutorialspoint.com/java/index.htm . if you want to learn a programming language, stay up to date. don't stay with not or half updated tutorial pages". why I think it's not entirely up to date? just check the "Java-Overview" page. I'll quote a bit. > As … | |
Re: hate to tell you, but even the first line of the code you posted wouldn't compile. you need to end it with a ';', not a ','. also, this: `}catch(IOException evt){JOptionPane.showMessageDialog(null," Error ");}` even though not the worst, not far from it. Ok, you know an exception got thrown. but … | |
Re: in CaseOne you don't change anything in an existing GUI, you just create a new one. but in my opinion, you're going way to far on this. try adding a setter (setFrameIcon(Icon (or Image) ... )) method to your gui, and call that from the other class. in your case … | |
Re: "what the errors are about" ... which errors do you mean? public static void printSelf(){ System.out.println("Name: " +name); System.out.println("Age: " +age); System.out.println("Gender: " +gender); System.out.println("Email: " +email); } in the scope of this method, the variables name, age, gender and email are not known. pass a parameter that is an … | |
Re: most likely, there's some configuration in an .init file (or another eclipse config file) that still points to the previous path of the Android SDK. but how did you "move" the SDK? just copy paste? at that point, each file that links or has a path to that SDK becomes … | |
Re: several ways: 1. don't store duplicate values in the original array. 2. keep a String (or a set or a list or a .... ) if you reach the else block, check if that String(/set/list/...) already contains the letter. if it does, skip the rest. otherwise, print it and add … | |
Re: Usman: this is not a "coders on demand" forum. if you want that software, write it. if you get stuck, let us know with what, and we'll try to help you. | |
Re: > For some unknown reasonable reason, I get an error for the static method call this is very normal. in a static context, you don't always have an instance, so you can't just call an instance method. public static boolean match(int[] a , int[] pattern) { //need to use the … | |
Re: you should start a new thread for a new question. you should also realize that 'a folder' is a part of the file system, not of the layout of a webpage. you'll need to be more specific about what exactly you're trying to do. | |
Re: I see no ImageIO class, and I see no import for an ImageIO class. that might be the problem. | |
Re: [this](http://stackoverflow.com/questions/16458564/convert-string-to-ascii-value-in-java) might answer some of those questions. | |
Re: > It's a pretty complex program. sounds like a genuine Java teacher allright .... Mussdroid: a few remarks: don't just send links with ready made code (especially if they a. don't do what the OP ask b. contain basic flaws, like by default having the main method throw an Exception) … | |
Re: ehm, sure. but a few remarks. this is a webapp, so it'll only be on your c drive while developing, after that, it should be on a server. you should also make sure your images are as compressed as possible. what kind of images do you have in your application, … | |
Re: you have two closing brackets on your doGet method. remove the second one, and you'll have less errors. I haven't checked every single bracket pair to see if there are some other places where you have missing/extra brackets, but if you indent your code, and re-check it, if need be … | |
Re: the best thing to do, is re-read the first chapter(s) of your textbook or course notes. | |
Re: create an enum, which has the value of a char as value. add the nr (of order) as a field field, use this to compare them | |
Re: that is because you don't remove the names already linked from the list to choose from. for (i=0; i<5; i++) { System.out.println(bName[(int)(Math.random()*5)] +" and "+ gName[(int)(Math.random()*5)]); } for all you know, the random returns exactly the same each time. since you didn't remove the name after having matched it, it … | |
Re: > it does compile without errors for the server side ... but I am not sure about 1 thing .. you do understand that mentioning what it is you have doubts about, might help us help you, right? | |
Re: you don't need to create a new instance of Scanner each time you read a value, that's just a waste of resources. do{ //printPlayRing(); //printBrig(); if(!gameOver()){ System.out.println(""); System.out.println("game not over Who got captured?"); Scanner caught=new Scanner(System.in); String check = caught.nextLine(); if(playRingContains(check)){ System.out.println("playRing contains"+check); } } }while(playRing.root.nextNode!=playRing.root); I might be missing … | |
Re: also: remove the static keyword from your variables. they shouldn't be static. | |
Re: the problem is, it can't find the resource you're trying to use. it's a NullPointerException. this is not related to the .jar, to the manifest file or anything. the .jar file runs just fine, if it wouldn't, it wouldn't print this: > The word is trap and the hint is … | |
Re: can you specify the 'not working' part a bit more? what is 'not working' ? does it compile? do you get compile time errors? does it run? are run time exceptions thrown? do you get a stacktrace? do you get an unexpected result? | |
Re: correcting what? does it compile? does it run? does it present a stacktrace? does it give unexpected results? .... ? don't just copy paste some code without an explanation saying "solve the problems". we don't know what the progrem is supposed to do, so what can we tell? | |
Re: first of all: java doesn't have functions, it has methods. yes, there is a difference. the main method has to be static, since it is the entry point of the application, the very first thing that runs. if it wasn't static, you would need an instance of the class to … | |
Re: NopeForever, no, that doesn't help. array[j] doesn't print the index, it prints the value. `System.out.println(" " + num + " is in index "+ j);` should do the trick. | |
Re: this 'll cause trouble, though `Ruu obj=new Run();` typo's in code is the easiest way to get it to crash during compilation | |
Re: keep in mind that on systems you want to use it as a 'click' executable, you'll need to have both 1. the jre installed (in order for it to run) 2. the environment settings of the os set, so the os knows how to handle the .jar file and it's … | |
Re: first answer that comes to mind: "surely worth 5 seconds of Googling". check [this](http://docs.oracle.com/javase/tutorial/collections/) | |
Re: why your code don't run ... how do you know it doesn't run? does it compile? do you get a compile time exception? do you get a run time exception? does it seem to do nothing? might be stuck in an infinite loop somewhere. did you debug your code? also: … | |
Re: step 1 write an analysis step 2 define objects/methods (based on the analysis) step 3 define test-cases step 4 write unit tests step 5 implement the code step 6 unit test what you've written step 7 correct any errors against the unit tests that may occur and repeat steps 6 … | |
Re: instead of this: `letter2=letter2+"a";` do something like: `letter2=letter2+aTextField.getText();` | |
Re: you have code like this: catch (Exception ex) { } this: catch (Exception ex) { chatTextArea.append("Message was not sent. \n"); } and this: catch (Exception ex) { System.err.println("Error telling everyone."); } I'm not surprised you're having trouble finding all the things going wrong. always make sure to log what is … | |
Re: and since it isn't private, you don't need a get-method to retrieve it. | |
Re: using polymorphism usually doesn't replace the if's/else statements. just the code within the if/else blocks would be different. | |
Re: for jsp related material, you should post in [this forum](http://www.daniweb.com/web-development/jsp/24) also, provide some more information. just that one line might get you a response, but the more information you can provide us with, the bigger the chance of us finding the correct issue. | |
Re: what is the actual question? what are you stuck with? | |
Re: if you know the logic, you should be able to figure out how to code it. that's the entire point. what step(s) are you actually struggling with, how did you try to implement it and what is it doing (wrong)? | |
Re: you may want to check those websites, just to see which language they're written in, and what framework(s) they use. are you trying to do this purely using javascript? | |
Re: if the code is like this, functionally there shouldn't be a difference. | |
Re: also: saying that you "have a question about it" will not help you find an answer just as fast as stating what the actual question is. | |
Re: e-Books are easier to update, but in the end, I want to be able to read my book, even when my tablet/... crashed. |
The End.