7,116 Posted Topics
Re: Assuming this is homework, check the DaniWeb Member Rules. Nobody will do this for you; but if you show effort we will help. Assuming, again, that this is hoewomrk, I doubt that it's designed to teach you how to copy stuff from the web. You are only cheating hyourself if … | |
Re: Line 173 etc... is that Java? | |
Re: Disagree. Never start with the GUI; always get the model first. Anyway - who said this was a GUI application? Vardaan: DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" … | |
Re: What is your question, exactly? | |
Re: It's line 152 (new BugfferedImage) that's going wrong - implying tha there's a problem with the ImageIcon/Image that you use to get the width & height. Try printing the ImageIcon and Image just before 152 so yu can see what's going on. | |
Re: It copies two elements starting with element 2 (NB: zero-based) to positions starting at 3. Ie it copies the values in indexes 2 and 3 (values 3 and 4) to indexes 3 and 4, overwriting the previous values of 4 and 5 | |
Re: The requirement seems incomplete to me, but I think it means: read an array of 100 numbers from a named file then read numbers from stdin. If each number matches, write an index/value message to the output file, OR, if the number causes an Exception then write an exception message … | |
Re: The message tells you the error is on line 200 - `y=rt.getTopY()-diameter;` - null pointer means uninitialised variable, or a method returned a null that you then tried to use. In that line the only thing that could be null is `rt`. Now look for that variable - it's declared … | |
Re: if(user_name<22) user_name is a String so you can't compare it to a number like that. Maybe you ahould be comparing the user's age, not their name? | |
Re: The System class has methods to get the current time. There's a nanosecond version as well, but your pc may not be able to supply such precise time. Just get the time before and after the sort, subtract them for elapsed time. If the result is less than about a … | |
Re: Oh dear, I'm almost as embarassed pointing this out as you will be... Your method is called `isValidVowel`, but you try to call a method called `isVowel`. Sorry J | |
Re: Time to face reality. You have (at least) 4 homeworks due tomorrow, and you haven't done anything. That's nobody's problem but yours. You will get all the help you deserve here, which is approx zero. We're saving our time for people who are making a realistic effort themselves. | |
Re: There's no way the client should be starting or stopping the server that is handling the communications with the client! Maybe your problem comes from confusing the server that talks to clients with the server that talks to the printer? In my mind they are two different things. | |
Re: What version of Java are you using. What is the O.S.? | |
Re: Java RMI would do that. It provides a version of the server's interface at the client end. Have a look at it, but be aware that it's pretty complicated and the learning curve is steep. You may find it a lot easier to build you own simple protocol where the … | |
Re: You can't draw things in Swing by just drawing to some random Graphics. You have to fit your drawing into the existing Swing mechanisms. [This tutorial](http://docs.oracle.com/javase/tutorial/uiswing/painting/index.html) explains what you need to know. If that leaves you with any further questions, just ask them here. | |
Re: > i am waiting?????????????????? Rudeness will not get you any quicker answers. Please feel free to wait until you decide to be polite. | |
Re: If you have a compiler or runtime error message post the complete message plus the actual code it refers to. If your code is giving an incorrect result explain what result you get and what the correct result should be. | |
Re: If you want comprehensive, then Oracle's own tutorial pages are the definitive source, very complete and totally up-to-date. Start [here](http://docs.oracle.com/javase/tutorial/reallybigindex.html). | |
Re: Sorry, nobody is interested in answering your little puzzle. Do you have a Java topic we can help with? | |
Re: What exactly do you expect anyone to do with that information? Did you have the owner's permission to reproduce that complete document on the web? Have you read the [DaniWeb Rules](https://www.daniweb.com/community/rules) that you agreed toi when you joined? | |
Re: When you are entering the item names etc, check to see if there is already an item in the ArrayList with that name and price. If there is, add the quantity to the existing Item, otherwize create a new Item like you do now | |
Re: The problem is that you throw the exception from the setScores method, which doesn't allow you to recover or continue after the exception. Data format errors are best handled inside the data entry code, something like (pseudo code) for each item that needs to be entered boolean needValidInput = true; … | |
Re: In real life nobody codes applications in bytecode. If you can't do something in Java then its very unlikely that you could do it in bytecode. Unless you plan a career in writing Java compilers or JVMs you will never write a single line of bytecode. The only time "normal" … | |
Re: Which mobile operating system? | |
Re: Just call `setVisible(false)` or `dispose()` on your JFrame. It's the same regardless of what you are doing with threads or timers. What's your real question - do you want to know how to use a timer? | |
Re: How about the "contains" method in the String class - or is that too obvious? | |
Re: You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrespectful to the many people who give their time to help others here. There are lots of people here who will freely give their time to help you become the best Java … | |
Re: What graphics are you using - Swing? | |
| |
Re: In the sort, instead of swapping names and gpas, just swap the two Student objects. That's easier, and it won't break when you add another field, eg date of birth, to the student class. It's also very bad practice for a sort to change the values in the objects its … | |
Re: ... also, you have two instances of Square1 (lines 11 and 21). You try to use the value from the first instance, but you only execute the run method for the second instance ... and, line 29, a printStackTrace() will show you the stack. getStackTrace() returns the stack, but you … | |
Re: Start by just sketching it out on paper. Fiddle with that until it looks goood. Then (and not before) think about how to implement that with panels, layout managers etc. | |
Re: ... the `doStuff(x,y)` case is a little more interesting: because there's no method that takes an int and a boolean, the best fit the compiler can find is to auto-box the int into and Integer object and the boolean into a Boolean object, then use the `Object...` method. | |
Re: I know nothing about Android development... but shouldn't there be some kind of reference to the audio source (file name etc) somewhere? | |
Re: You already have a default constructor (line 7). That's where you can set the X values. | |
Re: DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules | |
Re: Your isFull methods looks suspicious.. what's wrong with `count == elements.length` Also your code assumes the array is the default size (eg lines 34, 45). What happens if you try a queue of any other size ? | |
Re: The normal way to create a menubar as part of the frame and without confusing the content pane's layout, is main.setJMenuBar(menu); see http://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html | |
Re: You have not given any of the code, so we can only guess. It sounds like one of the needed methods has not been written yet. | |
Re: You are trying to convert Integers to ints, and you can't use generics to refer to primitive types. | |
Re: No. We don't do your homework! Read the [DaniWeb Rules](https://www.daniweb.com/community/rules), and start again. | |
Re: Each of your get methods calls the next get method, despite the fact that the original actionPerformed calls them all anyway. This will result in multiple calls to the later get methods, and thus mutiple error messages | |
Re: Maybe your computer is capable of running two threads at the same time? | |
Re: Do the keys really have all those newline characters embedded like that? | |
Re: Use String's `split` method with a regex that specifies one or more vowels. |
The End.