3,927 Posted Topics

Member Avatar for cproud21

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]

Member Avatar for Ezzaral
0
153
Member Avatar for ndeniche

And read through this tutorial as well: [url]http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html[/url]

Member Avatar for ndeniche
0
107
Member Avatar for platinum8

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 …

Member Avatar for R0bb0b
0
217
Member Avatar for nouryn

You just need this: [url]http://java.sun.com/docs/books/tutorial/2d/index.html[/url]

Member Avatar for Ezzaral
0
166
Member Avatar for itdupuis
Member Avatar for VernonDozier

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 …

Member Avatar for VernonDozier
0
122
Member Avatar for FSinister

You need regular expressions: [url]http://java.sun.com/docs/books/tutorial/essential/regex/index.html[/url]

Member Avatar for FSinister
0
130
Member Avatar for ndumbo

[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 …

Member Avatar for orko
0
609
Member Avatar for VernonDozier

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 …

Member Avatar for VernonDozier
0
176
Member Avatar for The_Kermit

You might find that stacks are pretty handy for keeping track of those compound expressions.

Member Avatar for brianlevine
0
121
Member Avatar for sbhavan

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. …

Member Avatar for Ezzaral
0
123
Member Avatar for Grub

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.

Member Avatar for ~s.o.s~
0
2K
Member Avatar for ronicasingh

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]

Member Avatar for Ezzaral
0
98
Member Avatar for new_2_java

I can't see any reason that you would want to. It would render the map useless.

Member Avatar for new_2_java
0
146
Member Avatar for aroesurya

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]

Member Avatar for Ezzaral
0
111
Member Avatar for shubhang

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]

Member Avatar for Ezzaral
0
85
Member Avatar for GrimJack

Sure, that's a great idea... until you actually think about it for more than one second.

Member Avatar for ZZucker
0
380
Member Avatar for BestJewSinceJC

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 …

Member Avatar for BestJewSinceJC
0
774
Member Avatar for Dave Sinkula

So where's the high score on this game anyway? :P [ATTACH]7801[/ATTACH]

Member Avatar for GrimJack
0
123
Member Avatar for cescbayo
Member Avatar for meteoroidkim

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.

Member Avatar for stultuske
-1
118
Member Avatar for kanwal_diku

[QUOTE=bumsfeld;714944][B]"Gud Delhi Photo"[/B][/QUOTE] I vote for this. Or "Gud Phto 4 U"

Member Avatar for twomers
0
139
Member Avatar for dhatfield

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.

Member Avatar for stultuske
0
70
Member Avatar for robynbrock84

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] )

Member Avatar for Ezzaral
0
69
Member Avatar for rthcupid
Member Avatar for Blackeagle

[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: …

Member Avatar for Ezzaral
0
135
Member Avatar for Koldsoul

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.

Member Avatar for Koldsoul
0
149
Member Avatar for Chaster

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]

Member Avatar for Ezzaral
0
85
Member Avatar for priti_s

[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 …

Member Avatar for Ezzaral
0
121
Member Avatar for askhan

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 …

Member Avatar for masijade
0
340
Member Avatar for gangsta1903

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.

Member Avatar for Ezzaral
0
3K
Member Avatar for cproud21

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]

Member Avatar for PoovenM
0
166
Member Avatar for ejosiah

[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 …

Member Avatar for javaAddict
0
169
Member Avatar for VernonDozier
Member Avatar for VernonDozier
0
261
Member Avatar for Dounia

VernonDozier, that post was from 2004. Lordonin just drug it out of the dust bin to beg for code.

Member Avatar for stultuske
0
1K
Member Avatar for jadeon77

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 …

Member Avatar for Ezzaral
0
183
Member Avatar for codered152

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(). ;)

Member Avatar for javaAddict
0
135
Member Avatar for arLe20

Then ask specific questions. We aren't going to explain every single line of that code for you.

Member Avatar for Ezzaral
0
137
Member Avatar for IKnowNothin'

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 …

Member Avatar for IKnowNothin'
0
287
Member Avatar for intelli

[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. …

Member Avatar for Ezzaral
0
221
Member Avatar for gangsta1903

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.

Member Avatar for gangsta1903
0
1K
Member Avatar for bops

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 …

Member Avatar for Ezzaral
0
142
Member Avatar for codered152
Re: list

Which is exactly what is in the link that Masijade already posted above. :-/

Member Avatar for Ezzaral
0
115
Member Avatar for Alohavik

Why did you start a duplicate thread on this? [url]http://www.daniweb.com/forums/thread148397.html[/url]

Member Avatar for shrughes
0
133
Member Avatar for Batool.Ahmed

Use [URL="http://java.sun.com/javase/6/docs/api/java/text/DecimalFormat.html"]DecimalFormat[/URL]

Member Avatar for Ezzaral
0
92
Member Avatar for nanna

And you need to use [noparse][code][/code][/noparse] tags around the code that you post.

Member Avatar for javaAddict
0
162
Member Avatar for stilldancin12

"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 …

Member Avatar for javaAddict
0
136
Member Avatar for PRob99

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.

Member Avatar for chan95
0
104
Member Avatar for katrinawafs

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...

Member Avatar for LizR
0
70
Member Avatar for Blackeagle

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.

Member Avatar for Ezzaral
0
55

The End.