7,116 Posted Topics
Re: Please note that there is a stick thread for exactly this - it's the first topic in the Java forum http://www.daniweb.com/software-development/java/threads/430542/java-projects-for-learners your additions to that thread will be very welcome. | |
Re: The Java language shouldn't cause you any problems at all (apart from some stuff around generics maybe) - it's just C++ for people with more than 16k RAM and no love of fatal addressing errors. The Java API is the real issue here. Java comes as standard with a vast … | |
Re: Howmuch memory does your PC have? How much is free before you start Eclipse? | |
Re: The source code of the entire Java API can be downloaded form Oracle. That's as high-quality as anything gets. | |
Re: This looks like homework. What do *you* think the answers are? | |
Re: There's a mistake you make on lines 17, 45, 49 and 54. You try to change the value of a parameter in a method. That's perfectly legal Java, but it won't do what you want. Java parameters are always passed as a *copy* of the original value. On line 17 … | |
Re: The answer. as always, is in the doc, the Java Language Spec in this case. Section 15.12.2.5. > 15.12.2.5 Choosing the Most Specific Method > If more than one member method is both accessible and applicable to a method invocation, it is necessary to choose one ... The Java programming … | |
Re: +1 for the Oracle doc, especially the tutorials. The other problem with books is that they get out of date. Remember there is a HUGE update to the Java language being released ths month. ALl the relevant doc is on the Oracle site, but it won't be in your book. | |
Re: After the for loop (Lines 34-38) i will be >= CurrentMonth.length, so that's why you have the error - array index out of bounds on line 45 | |
Re: Change the background of what? Please give more detail of your requirement. | |
Re: miles_per_gallon = miles / gallons; Because miles and gallons are both ints this division is done in int arithmetic. After that, the result is converted to double to match the target variable miles_per_gallon, but by then it's too late. | |
Re: The kind of bracket is important, [] is not the same as {} The number in [] defines the size of a new array... new int[7] is a new array of 7 ints, all zero The numbers in {} are a quick way of specifying the initial values of a … | |
Re: To close a JFrame and release all its resources you can call its `dispose()` method. | |
Re: ... but seriously, can you explain in more detail what you need? The brief sentence you posted didn't seems to make any sense. | |
Re: Realistically, I doubt that anyone is going to spend any time trying to understand undocumented unindented code with meaningless variable names. Maybe you could make it a bit easier? | |
Re: create an instance of the class Stack<String>, let's suppose it's called "theStack", then just pass that to the print method: print(theStack); | |
Re: One simple way is the use as many 200 as possible, then as many as 100 etc until what's left can be done in 10s. If you get this version working then it should be easy to upgrade to more complex "A.I." algorithms to give "desirable" mixes of notes | |
Re: Not in the standard API, no. May I guess that you have been set this as an exercise? | |
Re: Why not look atthe API doc for java.util.HashTable and its inner HashTable.Entry class. That will give you a good idea of what the public parts of a typical implementation look like. For your Entry constructor, there's no need for the hash parameter because every `key` has it's own hash - … | |
Re: Hi Xabush. Welcome to Daniweb. I'm not going to join in any sematic debate about "intermediate", but I will refer you to the top sticky in this forum, which is a compendium of useful resources for learners. Doing actual projects is the best way to learn, so the second sticky … | |
Re: Once you have the array sorted ascending then you get the descending order by simply starting with the last element and working all the way back to the first. Ie, if there are (n+1) entries entries, then the ascending sequence is indexes 0 - n, and the descending sequence is … | |
Re: I want, I want... There are lots of things we all want, but life isn't like that. 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: I think you have confused us with people who will do your homeowrk for you for nothing? If you have *specific* questions or problems then post them here and someone will help. | |
Re: > Do anyone have idea how to execute batch command in java. http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html | |
Re: Line 10 you calculate Math.pow(x, i); but you don't do anything with the result. | |
Re: Try getRemoteSocketAddress() instead of getInetAddress() | |
Re: Welcome to DaniWeb, and thank you for trying to help here, but after three years it's probably a bit late! ps: When you help answer people's problems please try to explain why they have the problem and how they should start to fix it themselves. Don't just post corrected code … | |
Re: You can add a TextListener to each text field (and ChangeListeners to radio buttons etc etc). You can use the same listener code for all of them - all it has to do is enable the Save button. | |
Re: Create a Map with the row values as key and an Integer count as value. For each row, if that value is already in the map, increment its count. If it's not in the map add it with a count of 1. You may need some convenient representation for the … | |
Re: Do you mean that you want the user to be able to type in 2 polynomials that you can then multiply using your existing code? | |
Re: Hi Lius. The purpose of your project is for you to learn and practice Java programming, not Googling. The only way to understand how to code this is to start at the beginning and solve each problem as you encounter it. We will help with that. You have a short … | |
Re: That's the "hello world" program that is the first program you learn in any language. There are many many suitable tutorials on the web. | |
Re: Eclipse comes in many different (free) versions, supporting different subsets of usage. You need to download a version that suports as much as possible of your needs, then download the remining pieces that you need. It's all explained here: https://www.eclipse.org/downloads/compare.php?release=kepler | |
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: Ideally you should enums for Suit and Rank - but maybe you have not covered enums yet in your course. | |
Re: Hello DeepakNarang Here at DaniWeb we try to help people learn Java and develop their Java skills. We do NOT do people's homework for them. Your post explains and teaches nothing. In future please help by pointing people in the right direction - eg tell them which classes and methods … | |
Re: That Class.forName hasn't been needed since JDBC 4. From 4 onwards drivers have registered themselves in their jar file manifests. JDBC was released in 2007 with JRE/JDK 6 https://today.java.net/pub/a/today/2007/04/10/whats-new-in-jdbc-40.html | |
Re: What size do you want it to be? Eg If you have multiple buttons do you want them all to be the same size? setPrefferedSize is a last resort really ,because you set the size in pixels the when someone runs yur code on a retina display it looks really … | |
Re: The compiler is your friend. If you compile this code the error messages wil show you some things to fix. In the meantime, here are some points: You create Person objects, but you put name and age into the Map. Shouldn't it be something more like (eg) name as key … | |
Re: The client code above reads a single byte array from the socket then closes the socket. Obviously that's not going to read multiple objects! Is there some other code you have that at least *tries* to read multiple objects? ps I have plenty of working systems that send mutiple objects … | |
Re: For simple images in Swing just read them into an ImageIcon and pass that to a JLabel. You now have a JLabel that's the same size as the image, containg the image, and you can position it using LayoutManager of your choice. The GUI builders in the big IDEs are … | |
Re: C# and Java are almost identical languages - switching between them is easy. .net is comparable with the Java API in function and scope, but differs totally in the details. They are both vast, take ages to learn a decebnt subset, but there's almost no specific knowledge that you can … | |
Re: What value should checkGuess return if the numbers are not equal? (Not -1, but what?). You left that bit out when posting the requirements. Anyway, in your code you create Strings like "Greater than the guess" then try to parse that as an int value. That won't work because the … | |
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: `is.read(bytes)` reads some number of bytes into the array, then returns an int with the number of bytes actually read. That value is assigned to the variable `read`. Depending on the type of stream that may be a complete array-full of bytes, or some smaller number, or even, in theory, … | |
Re: It's certainly legal Java to append strings like that, but horribly inefficient - every + or += creates a new String object. When you want to build up a String like that you should use a StringBuilder, which is a mutable class with methods like append(...) that are very efficient. … | |
Re: Line 11: You forgot to declare the type of the parameter. Line 13: That's not how to fix the <parameter with the same name as a variable> problem. Use `this` to refer to the variable, eg this.mode = mode; For what you are doing so far, I think you're right … | |
Re: Just to clarify what you said: if you `append` the text to the textarea it works ok, but change that one method to `setText` then it doesn't? | |
Re: ... and if not maybe someone has some ideas about how to write one? That would be a really ace project. | |
Re: ^ like he said. Post the code you use to create and set the initial position of the button, so someone can give you the appropriate answer. |
The End.