7,116 Posted Topics
Re: That looks right to me. I agree the CreditCheckFactory methods could be static - there's no need to instantiate a CreditCheckFactory. (ps: Without some way to make isAgencyUp() false you can't fully test your code. And there's no obvious reason why isAgencyUp() should be public.) | |
Re: > InvalidAlgorithmParameterException: Wrong IV length: must be 16 bytes long That seems perfecrtly clear! (The rest of the stack is useless here because the line numbers don't match the code you posted) What happens when you use an IV that is exactly 16 bytes long? | |
Re: We are just as confused as you are! Questions: * Why does the right key move the camera left? ("... if user keep right key down. than camera should move left ...") * Why would moving the camera make the player fall down? ("... camera should move left.and my player … | |
Re: One possible cause is that your firewall is blocking the connections. | |
Re: Define a Card class with instance variables for rank and suit. Create an ArrayList containing all 52 possible Cards to represent a deck. Take Cards at random from the deck to deal hands. Search the DaniWeb archives - there's lots of discussion about modelling card games | |
Re: [This](http://www.javamex.com/tutorials/cryptography/symmetric.shtml) looks easy | |
Re: Just a guess, but... you seem to be sending all the data as a single packet, so maybe you are creating a UDP packet that's too big for something in your network? | |
Re: Maybe this is revealing that the map[][] approach isn't a good one? If you defined ground as ab object like the movable ones, this would be easy? | |
Re: > In the first case, if you want to change the title of the jframe sometime later in your code ,you CANT change it . You have to create a new object inorder to change the title which is not what you need. @harinath: Do you have any reference material … | |
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: If one of your calls to isPerfect returns true then your allPerfect will execute the return on line 12, and that's OK. But if they all return false then allPerfect will drop out of the loop at line 13 and hit the end of the method without having executed a … |
Re: Is this to convert bewteen any two currencies (eg GBP <> EUR, EUR <> USD, USF <> GBP etc), or just between different currencies and one "base" currency (eg EUR <> USD, GBP <> USD, YEN <> USD etc)? I ask because you talk of a currency as the key, … | |
Re: I agree with ~s.o.s~ The coding conventions he linked to are not mandatory, but they are the ones used most widely, particularly in all the Java API code. All working Java developers will be familiar with them, so if you want your code to be quickly and easily readable for … | |
Re: You've run into a very common problem with Scanner. After nextInt() the following new line character is left unread, so when you do the next nextLine() you get a zero-length string ie "" It's a messy bit of design in Scanner, not your fault really. When yu have a nextInt() … | |
Re: Don't worry, this one often catches beginners out! You declare the method as returning a boolean, so the compiler checks your code to ensure that, no matter what happens in the if tests, you always return a boolean. In your code, if all three if tests are false, you will … | |
Re: I don't often do this but... http://bit.ly/YDa135 | |
Re: Here's the usual way to do it: in the bullet class have an update method (where you do x+=dx; etc)and a paint method. Maintain a list of all the current active bullets, and make that list available to the main class. In the main timer method call each bullets update … | |
Re: `case 4: System.exit(pin);` System.exit() immediately terminates your whole program, so it's a bad idea to call it when you just want to exit the current loop. You haven't indented your code, so I'm not going to waste time trying to understand how your loops are nested, but I would start … | |
Re: just call `setVisible(false);` for the first JFrame | |
Re: The panel that needs to be repainted is display_class, so when you change any values in the simulation you need to call `display_class.repaint();` to see the result. ps I find your variable names quite bizarre - I hope they're not the result os some misunderstanding? Eg you have an instance … | |
Re: Your model may consist of many classes working together - most models do. Similarly the view will almost certainly need quite a few classes | |
Re: 1. Make them buttons (or JLabels) in a JPanel and move them as required (use a null layout manager, set the button attributes to hide the usual borders etc) 2. Just draw them on a JPanel and have code that checks the mouse click coordinates against the position/size/boundaries of each … | |
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: That message doesn't seem to match the code - can you please copy/post the exact complete error message(s)? | |
Re: Do you mean a number without leading zeros, or without any zeros in it anywhere? | |
Re: on or This looks difficult! I looked at the source code for readPassword and it uses a native method to turn off echoing, plus the Console class is *final*, ie you can't extend it. I'd move on to something else if I were you. | |
Re: [Ljava.lang.Double;@35960f05 is what you get when you call toString() on an array of Doubles (which is what println does when you print anything - it calls toString() to get a printable version). That toString method is inherited from Object. There's a method in the Arrays class that converts arrays to … | |
Re: To fix the problem at its source convert the image file to a format that supports transparency, eg GIF and use an image editor to select end delete the background . | |
Re: What does line 8 do? Where do all those variables on line 9 come from? | |
![]() | Re: Your target panel now seems to add the dragged item to the panel, regardless of where it was dragged from. So for an "internal" drag it will get added again. In the earlier version of the code you seemed to using a list of added items in an attempt to … ![]() |
Re: A class diagram does not document a process; it's a static view of the class structure of a module or application. Processes like yours are documented in Use Case diagrams. The very shortest "how to" goes like this: Look through your process description. Underline the important nouns - these are … | |
| |
Re: You have made everything in LinearEquation static. That's wrong. You create instances of LinearEquation, and each instance should have its own instance variables and instance methods. Simply deleting every use of the worde "static" from that class will fix it, but in the meantime you should revise your course materials … | |
Re: " I get an exception" We're not going to guess what that could be. Exactly what exception at which line? - copy/paste complete message | |
Re: Looking at the two programs the differences in style and coding technique seem to point to two different authors... Elena (the O.P.) seems to have written the text editor using full NetBeams code generation, but the color/font edtor seems to have been lifted from mazmar. | |
Re: It woule be easier to use String's `split` method to split each line at the blanks into an array of words, then the last element in the array is the word you want. http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split%28java.lang.String%29 | |
Re: You are taking on a very steep learning curve, but... Oracle have a GUI builder/IDE called NetBeans that goes with Java. [Here's](http://docs.oracle.com/javase/tutorial/uiswing/learn/index.html) a very simple tutorial that will give you a feel for how it looks, at least on a simple example. Learning object-oriented programming is a whole other thing... | |
Re: It seems Oracle have rushed out a quick fix (or maybe just a sticking plaster?) for this one... http://www.oracle.com/technetwork/topics/security/alert-cve-2013-1493-1915081.html | |
Re: Your code repeats because you have a recursive call on lines 23/24 That's a strage way to do this, and will cause out-of-memory errors if you keep entering nunbers. Normally you would use a while loop for this. In that case you can declare and initialise a variable (eg int … | |
Re: I know naff-all about javax.amil, but you seem to be trying to override a method with your new javax.mail.Authenticator() { protected javax.mail.PasswordAuthentication getPasswordAuthentication(URLName name) {... but the API doc fpr javax.mail.Authenticator (Java EE 6) only has a `protected PasswordAuthentication getPasswordAuthentication()` method (no parameters), so you are not overriding anything with … | |
Re: It took about 2 minutes with Google to find [this](http://sourceforge.net/projects/jviewerlite/) | |
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: > I don't feel confortable using enum, for some reasons I don't like them, so if I can do without I feel happier. I do hope you will reconsider that. Enums were added to the language in Java 1.5 because Java needed them, and so do you. They are not … | |
Re: this may help http://www.roseindia.net/java/java-conversion/BinaryToDecima.shtml ... or not. That's a really tortuous and horrible way to see if a string just contains '0' and '1' (if you can work it out at all, given the lousy coding standards). There may be some good stuff on RoseIndia, but most of it,, like … | |
Re: Yes. I have that right now (Eclipse with Java 7 and Netbeans with Java 8 preview) | |
Re: Interesting question! To find all the colinear points presumably you can't just take their angles from one arbitrary point - you'll have to repeat that process using each point in turn as the "particular point"? If this is really just about colinear, the maybe there's a simpler answer using the … | |
Re: new ImageIcon(...) is famous for not throwing any exceptions when it fails to find the file; it's just empty. JLabel is happy to accept null for its image icon, so the final result is no image and no error messages. We see that quite often in DaniWeb "help!" posts. Use … | |
Re: Sounds like a really interesting project! Some ideas: You could use an ArrayList to hold a sequence of U/D/L/R/S(traight on)/B(ack) etc Characters as the genetic code - easy to process and easy to make a new one by mixing from 2 "parents" and making some random additions or substitutions ("mutations"). … | |
Re: if (rollTotal == 10) { rollHist[8] += 1; } (etc) There's a pattern- the array index is always two less than the rollTotal, so all those ifs can eb replaced with a single line of code something like `rollHist[rollTotal-2] += 1;` | |
Re: It would help if you told us what the error messages are. Copy/paste the entire messages, complete with line numbers etc. |
The End.