7,116 Posted Topics
Re: Line 67: Isn't this case where the brackets DO match? (wrong message text) Anyway, your bug is because the `else` on line 72 doesn't match the `if` you think it does. Fix your indentation and this should become clear, as will the fix. | |
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 Post what you have done so far and someone will help you from there. | |
Re: Either Use an inner loop that prints the correct number of asterisks or blanks for each window or Have a long-enough string initialised to lots of asterisks and print a substring of the right length from that | |
Re: Use a javax.swing.Timer When the timer expires it runs its actionPerformed method, where you can display a message or whatever you like. See the API doc for details | |
Re: I'm a huge fan of Scrum http://en.wikipedia.org/wiki/Scrum_%28software_development%29 It's the exact opposite of the useless waterfall approach. It's one of the original Agile class of methodologies. I worked for Jeff Sutherland http://en.wikipedia.org/wiki/Jeff_Sutherland in Easel in the 90's and everything we did was some kind of variant on scrum. It works. | |
Re: stultuiske's comments are correct, but his solution doesn't quite apply to your case. His advice is correct for printing an instance of a class you define, but not for printing ordinary arrays. The `Arrays` class has a static `toString` method to convert ordinary arrays to sensible Strings for printing, like … | |
Re: Hello Wilfred, welcome to DaniWeb. We don't do people's homework for them. If you have a specific problem with some aspect of Java then we're glad to help, but simply copy/pasting your assignment and waiting for an answer is just insulting. DaniWeb Member Rules (which you agreed to when you … | |
Re: Do you simply want to start the application in that jar executing, or do you want to use the classes inside that jar? | |
Re: I'm no expert, but maybe this will help: There's a simple formula for the distance between two long/lat points (Google!). You can rearrange that that to make the distance fixed and either the second long or the second lat the unknown. This will give you four new long/lat points, N.S.E.amd … | |
Re: There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you. DaniWeb Member Rules (which you agreed to when you signed up) … | |
Re: Your file name looks wrong - too many back-slashes. YOu only need two backslashes in your String literal to represent a single backslash in the file path | |
Re: Your second line creates a byte array of the right size, but you do not copy the data from the blob into that array, so the array is just full of zeros. Use `getBytes` to convert the blob to a byte array (see the API dec for Blob for details). | |
Re: Welcome to DaniWeb! People here will be happy to help you - but you'll get the best value from that if you ask specific questions. Looking at your code there are a few small points of feedback that jump out... You have a constructor that just goes on for hundreds … | |
Re: That's just a restriction on inner class binding to local variables (just ask if you want he full explanation). Simply make your timer variable an ordinary instance variable and the inner class will be abse to use it. | |
Re: Standard procedure: print all the variables at that line to see which one is null. It could be controller, controller.totalGoldLabel, game, or the returned value from game.getTotalGold() | |
Re: There's a lot of very tangled code there, so maybe best to start again and go one step at a time. First, you need to read the file and create an array of Computer objects. Read each line, extracting each of the values on that line to local variables, then … | |
Re: Did you look at the tuorials on the Eclipse web site, eg http://www.eclipse.org/articles/Article-Your%20First%20Plug-in/YourFirstPlugin.html or http://wiki.eclipse.org/FAQ_How_do_I_write_an_editor_for_my_own_language%3F | |
Re: How many times have we said this in the Java forum... Never NEVER *NEVER* do this when writing new code: } catch (Exception e) { } If/when there is an error you just told Java that you didn't want to know anything about it, and please discard the detailed error … | |
Re: Line 10 - the method name is spelled differently | |
![]() | Re: Beuase all the methods are the same, there's just one copy in memory. That's loaded when the class is loaded ie sometime before you first use it. The same is true of static variables. Memory for instances of classes is created when the instance is created - that's a few … |
Re: Hello Sardar. Welcome to DaniWeb. Please take a few minutes to familiarise yourself with DaniWeb Memnber Rules before posting. eg "Do ensure that all posts contain relevant content and substance and are not simply vehicles for external links" Also, this thread is 4 years old, so any answer will be … | |
Re: Why not just a scheduled clean-up that uses `map.remove(key)` to remove unwanted entries? | |
Re: This is from WikiPedia... > In 2007 Oracle announced, that for the upcoming release of Forms version 11, Jinitiator would no longer be needed and that users should migrate to the Sun Java plug-in. In January 2010, a product obsolescence desupport notice was posted saying that JInitiator would no longer … | |
This is my 10,000th post in the DaniWeb Java forum. so I hope I won't get an infraction for being off-topic. I just thought this would be the perfect opportunity to thank all the people who have helped to make this such a valuable and rewarding experience for me. I … | |
Re: This problem breaks down into two distinct stages: 1. Collect all the info from the user (10 names, 10 counts) and store those in two arrays... then... 2. Using that info stored in the arrays, use a loop (see above) create and start 10 threads You can't mix the user … | |
Re: You really haven't posted enough code to show where the problem lies, but from those two lines here's a guess... are you sure you are updating the mainPanel variable when opening the second main JFrame? | |
Re: If you Googled you would very quickly find the Oracle tutorial: http://docs.oracle.com/javase/tutorial/deployment/jar/index.html but if you are using NetBeans or Eclipse then both those IDEs have their own tools to simplify creation of jar files | |
Re: I'm sure there are people here who can help. *Exactly* what help do you need? | |
Re: Hi gianfranco Welcome to DaniWeb Thanks for your post, but did you notice the question was 3 years old? It's unlikely he is still waiting foir an answer! Also, we prefer to help people learn Java rather than just do their homework for them. Just giving a solution they can … | |
Re: If there's absolutely nothing in the beginner's project thread that "satisfies your needs", then maybe you can explain what your needs are, so someone can make suitable suggestions. | |
Re: Hello ZaneDarklace, welcome to DaniWeb. Is there a question associated with this code? | |
Re: You are looking at docs for JDK/JavaFX version 8, but using a version 7 implementation. There are many changes and enhancements in 8. You can download a "developer preview" of JDK 8 (includes JavaFX 8) from the Oracle web site. We're only a month a way from full release of … | |
Re: > It reads a sequence of strings, each on a separate line, and stores them in an array, let call it input1, with one string per cell, in the order they were read. > ... > Same thing with 2nd sequence. You have tried to combine these two steps into … | |
Re: The loop on line 17 looks suspicious. Why not loop all the way down the list? Line 15; what's the initial value of *game*? | |
Re: Here are some *simplified* answers to start with - you may want some follow-up questions. A class is a data type - think of it as a struct plus some related methods. Eg a Person class has individual variables for for name etc, date of birth etc and methods to … | |
Re: Which line does the error refer to? | |
Re: +1 for JLayeredPane - it's what it was designed for | |
Re: There's no problem mapping a Color to a point in 3D space, nor in associating a colored pixel or two with that point. As with any 3D data representation it may be more or less useful, depending on what the data is. If it maps to a surface then that's … | |
Re: DaniWeb Member Rules (which you agreed to when you signed up) include: "Do not hijack old threads by posting a new question as a reply to an old one" http://www.daniweb.com/community/rules Please start your own new thread for your question, and post your code to show what you have done so … | |
Re: Overridding `paint` rather that `paintComponent` is almost always a mistake. In this case you call super.paint - which paints the Panel *and all its children*, then draw the background image over the top of all that. You may also need to set one or more of size/preferredSize/minimumSize for your JPanel … | |
Re: Don't just take code and try to paste it into your program. Spend 10 brief minutes with the relevant tutorial so you will understand what to do, and why... http://docs.oracle.com/javase/tutorial/essential/exceptions/index.html @cgeier: It's better to use `e.printStackTrace();` in your catch so you get the complete stack as well as the exception … | |
Re: Missing the final } on the previous method. | |
Re: Naresh. It's good that you want to help, but your post exactly duplicates the solution given by dlarytm two days ago. Please take a moment to read the whole thread before posting, and ensure that your posts always add something new. Thank you. | |
Re: That looks like you didn't enter an int value in response to the "Enter first coeffecient: " prompt. ??? | |
Re: You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrepestectful 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: You will find much useful inmformation [here](http://www.daniweb.com/software-development/java/threads/99132/starting-java-java-tutorials-resources-faq) | |
Re: You can simplify this by using "else" rather than 2 "if" tests [CODE] if (hours<=40) pay = rate * hours; else pay= (hours - 40 * 1.5 * rate) + (rate*hours);[/CODE] or compress it all into 1 line with the "?" operator [CODE]pay = (hours<=40) ? rate * hours : … | |
Re: This is not a "we write code for you for free" service. If you are having a problem with some specific code you are writing then please explain exactly what that is. In the meantime, please be aware of the DaniWeb Member Rules (which you agreed to when you signed … | |
Re: What is your major subject for your degree? Plagiarism? Seriously: If you need to "make an app" then just copying someone else's code is not going to qualify. If you want help to design and develop a pothole detection app then please free free to ask any *specific* questions here. |
The End.