1,678 Posted Topics

Member Avatar for chern4ever
Re: path

[url]http://www.devx.com/tips/Tip/5697[/url] That will help you locate resources using getResource(). Note that when you run a file, you are not running a .java file so it isn't like you can say "where am I?" and get back the location of a .java file.

Member Avatar for chern4ever
0
73
Member Avatar for JuneM

[url]http://java.sun.com/docs/books/tutorial/uiswing/components/applet.html[/url] ^ A useful resource on how to make applets. Besides not needing the main method (if that is the case, which I think it is), you declared your main method incorrectly - you have a ";" after the closing parenthesis, which is going to cause errors.

Member Avatar for sincerelibran
0
406
Member Avatar for vampgirl13

hello world only has [I]10[/I] alphabetic characters, not 11. What exactly do you want your program to do? In any case you can use the Character class's isSpace, isWhitespace methods, etc [url]http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html[/url]

Member Avatar for vampgirl13
0
109
Member Avatar for nicole200718

[CODE]JOptionPane.showInputDialog(null, "Please enter a song title: " + Song.SENTINEL + " to quit:");[/CODE] should be [CODE]title = JOptionPane.showInputDialog(null, "Please enter a song title: " + Song.SENTINEL + " to quit:");[/CODE] and similar methodologies can fix the rest...

Member Avatar for BestJewSinceJC
0
108
Member Avatar for 88omar

Do you think you might be able to use De Morgan's laws? [url]http://en.wikipedia.org/wiki/De_Morgan%27s_laws[/url]

Member Avatar for 88omar
0
140
Member Avatar for josolanes

Hi Josh, welcome to the forums, looks like you have an array of languages under your belt already - where do you go to school?

Member Avatar for josolanes
0
69
Member Avatar for searchermore
Member Avatar for ryan_vietnow
0
38
Member Avatar for Geodude0487

In your Login class, you have a method called set. It should be called "add" because it adds a String to the ArrayList. And I don't see what line you're talking about. What line number is it on (as far as the line numbers to the left of your code …

Member Avatar for Geodude0487
0
126
Member Avatar for Waseem2010

Since I've heard of Flex and not Tibco I know that my company is interested in Flex, but that doesn't mean [I]yours[/I] is. Why not talk to someone at your company about the pros and cons of each?

Member Avatar for stultuske
0
86
Member Avatar for ArtphotoasiA

And they are absolutely right. If you cannot offer services on the internet that are harmless in concept, but subject to abuse, then you cannot offer the same level of service and the same experience to your customers. No one can be reasonably held accountable for something like that when …

Member Avatar for Lardmeister
0
190
Member Avatar for xxunknown321

Use a Scanner. Really, the exact way to do it depends on how your text file is set up, but [URL="http://java.sun.com/docs/books/tutorial/essential/io/scanning.html"]here[/URL] is a general tutorial on Scanner.

Member Avatar for BestJewSinceJC
0
198
Member Avatar for Polaris87

And what is your formula for monthly payment [I]supposed[/I] to be? I don't have a mortgage currently, and I don't know that information. But I'd think it'd be based on the total amount of time you plan on paying off the mortgage over ..

Member Avatar for BestJewSinceJC
0
149
Member Avatar for gaya88
Member Avatar for PopeJareth
0
166
Member Avatar for ipride
Member Avatar for happygeek

[QUOTE=Dave Sinkula;1146684] I think Cprog was down and I started searching for other forums. (And later, I was a bit of a Jul groupie.) After a while, I liked the features and things that I could do here that I couldn't on other sites. (Most of these have since been …

Member Avatar for Dave Sinkula
0
524
Member Avatar for coloradoboy2

My worst secret is that I thought this was a serious thread, but then clicked the link and loled at those poor peoples' broken hearts, but I don't want you guys to know I thought the link was mildly funny, so instead, I leave you with this: stop spamming daniweb, …

Member Avatar for soccerjerseys
-5
140
Member Avatar for cjsowm

It is hard to help you when you don't use code tags. You can either call the other class's main method using OtherClass.main(args go here) or you can figure out how to use Runtime.getRuntime.exec(). Those are the only two methods I know of but in my ~4 years of Java …

Member Avatar for BestJewSinceJC
0
193
Member Avatar for tquiva

Read [URL="http://www.gidnetwork.com/b-66.html"]this[/URL], it was originally posted on Daniweb by WaltP in [URL="http://www.daniweb.com/forums/thread256856.html"]this[/URL] thread.

Member Avatar for tquiva
0
228
Member Avatar for Bemani_lover

That is because the way you wrote it doesn't save any of the values after they are read in - in this section of code, you ignore the return value of showInputDialog, hence, you never store the value the user entered, and it is lost. [CODE]JOptionPane.showInputDialog(null, "Please enter the grade …

Member Avatar for kvass
0
173
Member Avatar for whoadiz
Member Avatar for linkinmal

Probably because whatever method repaint() indirectly calls (paint or update, I don't remember which) must be clearing your background. Get rid of the call to repaint() and instead try calling revalidate(). If that doesn't work and you post the rest of your code, I'll play around with it later tonight …

Member Avatar for linkinmal
0
838
Member Avatar for Xufyan

Because you don't do your own homework. Or maybe it is because j++ already increments the variable j so storing that result into the variable j is redundant. Take your pick. edit: Oh, goodie. I just learned after reading your other thread that [URL="http://www.daniweb.com/forums/thread264294.html"]WaltP just told you the exact same …

Member Avatar for WaltP
0
286
Member Avatar for omeli

^Haha. You can easily look up the correct way to define a main method on google. Keep in mind that main is the method that runs when you start your program. Read about methods here. [url]http://java.sun.com/docs/books/tutorial/java/javaOO/methods.html[/url]

Member Avatar for kvass
0
229
Member Avatar for kvass

[QUOTE=balmark;1145192]If you want to screw about with crap like 'OuterClassDemo.this.displayText' I'm glad you don't work for me, I assume your code is unreadable you arrogant little fish.[/QUOTE] The Java tutorials make extensive use of anonymous inner classes and there are numerous articles online explaining their advantages. I assume the reason …

Member Avatar for javaAddict
0
177
Member Avatar for avinash_545

Object.getClass().getName(); Obviously that won't work on primitive types. But why do you want to do this to begin with?

Member Avatar for javaAddict
0
269
Member Avatar for cms271828

Place it in a JScrollPane to begin with. You should always have it in the Scroll Pane and set the Scroll Pane up so that it sizes how you want to. Don't keep putting it in and taking it out. See [URL="http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html#sizing"]how to size a scroll pane[/URL]

Member Avatar for cms271828
0
94
Member Avatar for miyu15

Yeah. fileChooser.getSelectedFile() will return a File Object. Then you can use the basic I/O methods provided in the Java libraries to open, read, then write that file to whatever location you want.

Member Avatar for BestJewSinceJC
0
97
Member Avatar for Majestics

[url]http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html[/url] JMenuBar, then you add JMenuItems to it if I remember correctly. In any case all the info you need is there.

Member Avatar for Majestics
0
100
Member Avatar for LucarioWill

[CODE]String f = firstLabel.getText(); float fi = Float.parseFloat(f);[/CODE] That is the source of your first error. You are trying to parse "Fahrenheit: " as a float. It is a String. And we don't get rewards for helping people here. Besides which, giving away free copies of BioShock is undoubtedly illegal, …

Member Avatar for Ezzaral
0
132
Member Avatar for Eternity[LK]

I type with two fingers, and I probably type at well over 60 wpm, (over 70 according to some typing thing someone posted here - but who knows how accurate that was). My advice is just to type however you want and to do so more often. Save your money …

Member Avatar for WaltP
0
238
Member Avatar for crazy lady

In your switch statement you put the numbers in "". They can't go in quotes. You also capitalized the word Switch. It should be in lowercase. [url]http://java.sun.com/docs/books/tutorial/java/nutsandbolts/switch.html[/url] Also, again, you did not use code tags. Read the rules stickied at the top of the forum.

Member Avatar for javaAddict
0
77
Member Avatar for crazy lady
Member Avatar for kvass

It's respectable that you posted a code snippet, despite the many reasons one could find not to do so. So respect to you for that. And I typically just up vote or leave a reputation comment (which auto up votes) if I see down votes that appear to be for …

Member Avatar for kvass
-1
199
Member Avatar for ajay_tabbu

Your code only works if args.length >= 2 and if the args can be parsed as integers. In short, it is almost useless. As is upping a thread that is 3 years old.

Member Avatar for BestJewSinceJC
0
163
Member Avatar for sandyben

It isn't working because on line 33 you have [CODE] JTextArea textArea = new JTextArea( 5, 10);[/CODE] but you should have [CODE]textArea = new JTextArea(5,10);[/CODE]. If you leave it as the way you have it, then you are creating a completely different JTextArea than the one you are referring to …

Member Avatar for sandyben
0
2K
Member Avatar for themarval

When peter says 'run random...' he means to generate a random number that is between 0 and the length of your array - 1. The reason for this is because if an array can store 5 numbers, then array[0], array[1], array[2], array[3], and array[4] are the storage spots. Hence the …

Member Avatar for BestJewSinceJC
0
150
Member Avatar for COKEDUDE

It is called an if statement, not an if loop. Only structures which repeat are called loops, such as for loops, do while loops, and while loops. If you can't use a return; or a break; statement, you could simply have a boolean variable (actually an int in C) and …

Member Avatar for abhimanipal
0
145
Member Avatar for BuhRock

It ends the program. [url]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#exit%28int%29[/url]

Member Avatar for kvass
0
146
Member Avatar for beGinneR24

Kvass is right, but that isn't all you need to know to be able to do your program. Since the user is entering two words separated by a space, you will need to be able to get those two words into two separate Strings before you can follow Kvass's advice. …

Member Avatar for BestJewSinceJC
0
128
Member Avatar for Taimoor Rana

It is called deleting an element from an array, not deleting the array. Just a little terminology thing - you sounded like you were saying you wanted to delete the entire array. Anyway, you can do this by moving each element back one like you suggested. So you'd need to …

Member Avatar for BestJewSinceJC
0
165
Member Avatar for Majestics

I'm not really sure what that means, as the previous poster suggested, perhaps you should elaborate. [URL="http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html"]JOptionPane ?[/URL]

Member Avatar for BestJewSinceJC
0
94
Member Avatar for devstarter

[URL="http://java.sun.com/docs/books/tutorial/uiswing/events/focuslistener.html"]Focus Listener Tutorial[/URL] And changing the background color is just a question of looking up the methods in the JTextField API.

Member Avatar for BestJewSinceJC
0
48
Member Avatar for needhelpbadly

We don't get anything for helping you, so when you ask questions that waste our time, you usually get mean or sarcastic responses. If you get a response at all. See [url]http://lmgtfy.com/?q=draw+a+diamond+java[/url]

Member Avatar for VernonDozier
0
108
Member Avatar for Dasau

You can't use doubles with switch statements. You can only use ints or chars. So it is saying possible loss of precision probably because it is automatically downcasting the double to an int.

Member Avatar for BestJewSinceJC
0
476
Member Avatar for Danny_501

You're misunderstanding the concept of a for each loop. Change the code to this: [CODE]final int[] message = {60, 80, 100...} for(int i: message) { System.out.print((char)i); }[/CODE]

Member Avatar for Danny_501
0
208
Member Avatar for GlockComa

It sounds like pretty much any Scripting Language could do this task easily. I just started learning scripting languages though, so. . I digress. Either way though, this question would be better suited for the Computer Science forum, or you could go ahead and post it in one of the …

Member Avatar for chrishea
0
203
Member Avatar for miles.85

If you want to read all of the ints from a File one by one then use Scanner and use the nextInt method. If you want to read an int using RandomAccessFile, it has a readInt method.

Member Avatar for miles.85
0
284
Member Avatar for EPhantom

The major is more than likely called Computer Science, it is impossible to say what programmers "generally" work on - jobs in computer science vary greatly, pay scale also varies greatly depending on area and individual but right now I think 50K would be considered low for a starting salary. …

Member Avatar for jwenting
0
158
Member Avatar for devstarter
Member Avatar for Majestics

Yeah, there are plenty of other forums, why don't you go get help there?

Member Avatar for jamesonh20
0
83

The End.