3,927 Posted Topics
Re: Well, writing your own IllegalArgumentException class is wrong for one thing, since [URL="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html"]there is already a standard exception with that name for that same purpose[/URL]. [URL="http://books.google.com/books?id=ZZOiqZQIbRMC&pg=PA176&lpg=PA176&dq=java+standard+exceptions&source=bl&ots=UZM03ofIa_&sig=PW-Ln0FynkTE0zcR2W972qJSDyc&hl=en&sa=X&oi=book_result&resnum=5&ct=result"]Read this about using standard exceptions where possible.[/URL] | |
Re: And read through this tutorial as well: [url]http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html[/url] | |
Re: A flat TV is, well, flatter. Persons who are unhappy with the less-flatness of the ordinary TV will appreciate the more-flatness of the flat TV, but of course even the flat TV still has some degree of not-flatness. Those seeking absolute flatness will likely still be unhappy with current flat … | |
Re: You just need this: [url]http://java.sun.com/docs/books/tutorial/2d/index.html[/url] | |
Re: For launching the default browser, we use a small utility class called BrowserLauncher that one of the guys here found a few years back in a JavaWorld posting. I've pasted that into your example code as a static class (just for convenience - it should be a public class of … | |
Re: You need regular expressions: [url]http://java.sun.com/docs/books/tutorial/essential/regex/index.html[/url] | |
Re: [QUOTE=ndumbo;717327]HI my package reads file from txt format only. it does not read .pdf or .doc file. is there any single java library that opens any kind of file format as stream and then reads or manipulates its contents.[/QUOTE] The literal answer is yes: [url]http://java.sun.com/javase/6/docs/api/java/io/package-summary.html[/url] The actual answer to the … | |
Re: I would just guess it stems from the fact you created a fixed size buffer image and rendered the red circle on it without anti-aliasing. You then draw that image in paintComponent. The image itself will be unchanged and I don't think turning on anti-aliasing in paintComponent will affect that … | |
Re: You might find that stacks are pretty handy for keeping track of those compound expressions. | |
Re: Ok, with your method[code]public void UpdateTransaction(String q1, String q2, String q3, String q4, String q5, Connection con)[/code]what happens when you only want to execute 2 statements or you need to execute 10 statements? Consider using a List as a parameter instead of coding in an arbitrary set of numbered parameters. … | |
Re: Take a look at the classes available in [URL="http://java.sun.com/javase/6/docs/api/java/util/zip/package-summary.html"]java.util.zip[/URL]. They have implementations of CRC32 and Adler32 checksums that may be of use. | |
Re: Swing uses layout managers to control the size, position, re-sizing behavior, etc. of the components. You can find a tutorial on them here: [url]http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html[/url] | |
Re: I can't see any reason that you would want to. It would render the map useless. | |
Re: It's very difficult to understand what you are asking for, but it sounds like you might want to look at these: [URL="http://www.netbeans.org/"]Netbeans[/URL] [URL="http://www.eclipse.org/"]Eclipse[/URL] | |
Re: One operates on a byte stream from a reader, while the other operates on a String (from any source, not just an input stream). You may want to read this for further clarification between the two: [url]http://www.codeguru.com/java/tij/tij0113.shtml[/url] | |
Re: Sure, that's a great idea... until you actually think about it for more than one second. | |
Re: There is certainly no reason to dispose of a frame and re-display it to update data, and main() should only be called once in a program as an entry point to minimally set up the object(s) your program needs to run. To update data in a table, update the table … | |
Re: So where's the high score on this game anyway? :P [ATTACH]7801[/ATTACH] | |
Re: Please clarify. The question makes little sense. | |
Re: What's wrong is that you posted that wall of code without code tags, creating an awful mess that no one is going to wade through to find this vague "event" you refer to. Not urgent. | |
Re: [QUOTE=bumsfeld;714944][B]"Gud Delhi Photo"[/B][/QUOTE] I vote for this. Or "Gud Phto 4 U" | |
Re: Separate the number to the units you want to represent with division, mod, etc. Then use an array or map to translate the digits to words. | |
Re: Still spamming the Tori thing around, eh Robyn? ( [url]http://www.google.com/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=%22Robyn+Fontana%22[/url] ) | |
Re: Post your code and specific questions. | |
Re: [QUOTE=Blackeagle;714600]i didnt know if to open a new thread .. but i'm having another problem .. probably casting will do it, but i'm not sure. i'm filling a stack with many variable: [B]Strings[/B] and [B]int[/B] when i pop, it returns me a value of type [B]Object[/B]. so my Questions is: … | |
Re: You could use [URL="http://java.sun.com/javase/6/docs/api/java/util/Scanner.html"]Scanner[/URL] or a simple [URL="http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html"]BufferedReader[/URL] and the [URL="http://java.sun.com/javase/6/docs/api/java/util/regex/package-frame.html"]regex[/URL] classes. | |
Re: There are quite a few file comparison utilities listed here, some of which are GPL: [url]http://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools[/url] That might be a decent place to start, along with [url]http://www.google.com/search?q=file+comparison+algorithms[/url] | |
Re: [QUOTE=priti_s;713688]Hey, thanks, but from exam point of view, what shall i write True or False? From examples it is clear that surely we can add, but it's not recommended, isn't it? So shall i go with option "True"?[/QUOTE] You should answer [U]your exam[/U] question based upon your understanding of the … | |
Re: Actually, you pretty much [I]are[/I] asking someone to solve it for you, since you didn't seem to read the link that Jasimp posted and you haven't asked any questions that would indicate you have tried anything or given it serious consideration. Any advice given here is purely on a voluntary … | |
Re: Just use [URL="http://java.sun.com/javase/6/docs/api/javax/swing/JLabel.html"]JLabels[/URL] for the nodes and [URL="http://java.sun.com/docs/books/tutorial/2d/index.html"]override paintComponent() on your panel[/URL] to render the lines between them. | |
Re: You need to re-examine your notes on class design and object-oriented concepts. You don't stuff all the code in a class in a static main() method. [url]http://java.sun.com/docs/books/tutorial/java/concepts/index.html[/url] | |
Re: [QUOTE=ejosiah;539377]1.) using BigDecimal will still not give u the right answer it just gives you a longer floating point value plus this problem does not exist in c# so Sun should have done something about it regardless of floating point representation.[/QUOTE] Well, sorry, I guess you are just going to … | |
Re: That still involves runtime instanceof checks. I would agree with Narue's suggestion. | |
Re: VernonDozier, that post was from 2004. Lordonin just drug it out of the dust bin to beg for code. | |
Re: Well, using [icode]x -= 1;[/icode] to represent the much simpler and easier to read boolean [icode]found=true;[/icode] isn't doing you any favors for one thing. You also need to read the API doc on the [URL="http://java.sun.com/javase/6/docs/api/java/util/Scanner.html"]Scanner[/URL] class, especially the general portion at the top and consider that in the context of … | |
Re: I think you may have meant[code] Map<String, Integer> map = new HashMap<String, Integer>(); map.put("ONE", 1); int value = map.get("ONE");[/code] Missing type on declaration and redundant cast on map.get(). ;) | |
Re: Then ask specific questions. We aren't going to explain every single line of that code for you. | |
Re: Have you used the search feature here? There are a ton of threads just like this begging for a project idea. Write a program to do something you find interesting. We don't know a thing about your interests or skill set, so how do you figure we're going to pick … | |
Re: [icode]num1 = generator.nextInt(90)+ 10;[/icode] will add a random int between 0 and 89 to your base value of 10. From the API doc:[quote]Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive)[/quote] A little bit of experimentation would have quickly yielded the answer for you. … | |
Re: Josh Bloch has an excellent article specifically on substitutes for C constructs here: [url]http://java.sun.com/developer/Books/shiftintojava/page1.html[/url] It is an actually a chapter except from his book [I]Effective Java Programming[/I], which I would highly recommend for any Java programmer. | |
Re: That constructor creates a new JTree with a [URL="http://java.sun.com/javase/6/docs/api/javax/swing/tree/DefaultTreeModel.html#DefaultTreeModel(javax.swing.tree.TreeNode)"]DefaultTreeModel[/URL] based upon the root node you supply. If you wish to modify the tree, you can either modify the contents of that tree model directly (by adding or removing nodes wherever you like) or you can construct a new [URL="http://java.sun.com/javase/6/docs/api/javax/swing/tree/TreeModel.html"]TreeModel[/URL] and … | |
Re: Which is exactly what is in the link that Masijade already posted above. :-/ | |
Re: Why did you start a duplicate thread on this? [url]http://www.daniweb.com/forums/thread148397.html[/url] | |
Re: Use [URL="http://java.sun.com/javase/6/docs/api/java/text/DecimalFormat.html"]DecimalFormat[/URL] | |
Re: And you need to use [noparse][code][/code][/noparse] tags around the code that you post. | |
Re: "stinkin java won't read the "sdf"" because you haven't "stinkin" declared it properly in any of the code you posted. You would need to do this: [code]SimpleDateFormat sdf = new SimpleDateFormat ("EEEE MMMM DD, YYYY");[/code]and even then, masijade's right - it isn't going to work your class just because you … | |
Re: There are conditions. Simply trace them for yourself. Also, you should get in the habit of always using the braces around the statements following the conditional, even if it is a single statement. | |
Re: Sure, just like you would in any other program or in a paper ledger: NetPay = GrossPay-Witholdings Of course, a more specific question might get a more specific answer... | |
Re: Why would you need to declare them? If you're going to multiply matrices then they would be the parameters to the method. Perhaps you need to post your method signature and intent if that is not applicable to your goal. |
The End.