2,443 Posted Topics
Re: Use a Panel with FlowLayout on that "Card" of the CardLayout? | |
Re: Yes. A good rule of thumb, I've found, is that public (and maybe protected) methods should use the interface (I.E. list) as parameter and return types. Whereas private (and maybe default) methods could easily use the implementation (I.E. ArrayList). This second part can make changes more widespread when a change … | |
Re: [QUOTE=seanbp]What about Python inspired iteration? [CODE]byte range[] = new byte[5]; for (byte nul : range) { System.out.println("do stuff"); }[/CODE][/QUOTE] Uhm, you [i]do[/i] realise that [i]that[/i] is [i]still[/i] a for loop, right? (In [i]your[/i] code anyway, what actually gets compiled is an Iterator with a while loop.) | |
Re: Why not "write the download" in Java? How is it being downloaded? If by FTP google for an FTP library (apache provides one), if by http, see the API docs for HttpURLConnection, if by SSH see [url=http://www.jcraft.com/jsch/]JSch[/url]. | |
Re: The "connection object coming to it" is the one provided to it by whatever calls it. What calls it? Where did that get its connection? I assume you [i]do[/i] know what [i]your[/i] program does, right? | |
Re: See Above link. The class you want is probably HttpUrlConnection. | |
Re: With an object to "record" the coordinates of the line and then either drawing, or drawing over, the line on button click using an actionlistner and swingutilities. | |
Re: Closing this meaningless zombie now. | |
Re: You won't find any "good tutorials on web crawlers". That is a bit of a broad subject. Find some tutorials on HTML parsers and HttpUrlConnection as well as some good general explanations of what a web crawler consists of and go from there. | |
Re: No, that is [i]not[/i] "putting it on the classpath". Do not put [i]anything[/i] into the jre/jdk directories. If executing/compiling from the command line (without the -jar option) use the -cp option, if running from the command line with the -jar option, correctly configure the manifest file and place the jar … | |
Re: You will have to ask the designers of the language because it was their [i]conscious[/i] decision not to include. Most people assume it was to avoid the problems that C++ currently has with Diamond inheritance. P.S. Java [i]does[/i] have multiple inheritance of [i]Type[/i] (you can include as many interfaces as … | |
Re: Open a text editor, type code, save, exit the editor, open a command shell, cd to where you saved the code (with a .java extension and the same name as the public class contained) use javac to compile, and java (or javaw) to execute. | |
Re: Because there [i]is[/i] no parseString method in String. Simply assign the provided String to the new variable. The API docs are your friend, BTW. Ask them [i]first[/i]. | |
Re: Close the bufferedwriter and not the file writer. By closing the filewriter you are probably preventing the bufferedwriter from flushing. | |
Re: Because toString() is called using Objects declaration, in that case, and polymorphism causes Date's toString() method to be used. You do know that imports have [i]no[/i] effect on a compiled class, right? They are not even there anymore. They exist solely in the source files and solely for programmer "convenience", … | |
Re: A "marker" interface is an interface with no methods and no variables and simply used to "mark" a Class. I don't think an example should be necessary. | |
Re: Because [i]everything[/i] about Apple is proprietory and they [i]want[/i] it that way, and they want to [i]keep[/i] it that way. | |
Re: Okay? Nobody writes error free programs in a first draft (or even 100th, many times), so what's the problem? | |
Re: See the API docs for SimpleDateFormat and attempt to define as many formats as possible and attempt to parse them with leniency off. [i]Not[/i] an easy task, but I don't know of any API that already does it. | |
Re: Because your array contains all null references. When you create an array of Object (regardless of the Object type) all it creates is an array of references, but, until you assign the reference to an actual object to those slots, the slots are filled with null references. | |
Re: Okay, so lets see what you have. And, if by "help" you mean that we should write (any part of it) [i]for[/i] you, then you can forget that now. | |
Re: Well, you want to actually set a value in index 24, right? So it is either <= 24 or < 25 (the same goes for the 49). You also want to set the value at that index so what is the length reference doing there? Also, the last half should … | |
Re: Uhm, should that not be [url]ftp://ipaddress?[/url] | |
Re: Because the hashCode is based on the Strings [i]value[/i] not its reference. | |
Re: Okay, lets say your locks are numbered 1 - 5 (looking at your max min loop). Now, lets say two threads are working, one doing a forward sort and one doing a backword sort. Now, lets say the one doing the forward sort gets a lock on say lock three, … | |
Re: Didn't do your midterm project and now looking for one to copy, huh? | |
Re: Please at least let people know that you are [url=http://www.java-forums.org/new-java/36105-get-my-conecpts-right-please.html]cross-posting[/url]. | |
Re: [url=http://download.oracle.com/javase/1.5.0/docs/guide/language/generics.html]Generics[/url] | |
Re: Well, if your starting it as an application (and not an applet or web service or etc) then yes (assuming the actual "m.End()" method creates and displays the GUI). If the JFrame is being created in the constructor (and "MyClass" extends JFrame) then you should change that. Make "MyClass" extend … | |
Re: Well, why don't you tell us [i]what[/i] your exact problem is and post a small, self-contained, compilable piece of code that demostrates the problem. | |
Re: [i]What[/i] exception? The full stack trace please. And [i]don't[/i] do [code]catch(Exception e){ JOptionPane.showMessageDialog(null,"Error in connectivity"); }[/code] Show the [i]actual[/i] exception not some meaningless string. Edit: Or, at least, not [i]only[/i] the meaningless String. | |
Re: Uhm, 1. You [i]do[/i] know that this thread is a 2+ year dead zombie, right? Why did you resurrect it? 2. You [i]do[/i] realise that the respone Phalax made was a sarcastic insult on the OPs typing skills, and not a serious suggestion, right? Closing this thread now. | |
Re: Instead of using "this" use an instance of the other class. | |
Re: See the API docs for the Comparator Interface (and google a tutorial or two) and then use the Collections.sort(List<T>, Comparator<T>) method. | |
Re: Sure we can. Post your code and a specific question and we'll be happy to help [i]you[/i] correct/improve/complete [i]your[/i] code. | |
Re: Nope. static methods are [i]class[/i] specific. I.E. They apply to that class and that class only. If a subclass then declares a static method of the same name and parameters as its super class it then "hides" the method from the super class (when accessed through the subclass), but does … | |
Re: Edit: Nevermind that. You use the JOptionPane for each of the numbers, not the sum. | |
Re: Stick to original [url=http://www.daniweb.com/forums/thread329067.html]thread[/url]. Closing this thread now. | |
| |
Re: Well, lets see your code, but, to tell you the truth it is nothing but a small, simple GUI, a FileReader and String's split method. | |
Re: [QUOTE=spades0001]I'm trying to make it color red. I've been trying to change the color for 2 days[/QUOTE] Where? Nothing in that code attempts to change the color of [i]anything[/i]. | |
Re: See the API docs for (and/or search for a tutorial on) TimerTask and Timer. | |
Re: [Code=Java]FOR CONVERTING COLOR IMAGE TO GREYSCALE IMAGE and creating the histogram of that greyscaled image .Including header files also...[/Code] | |
Re: And your question? One note though, I would use "names.length" rather than "18" in your random number generation. I would also make "r" an instance variable rather than creating a new one with every call to "getPartner". | |
Re: [url=http://download.oracle.com/javase/1.5.0/docs/guide/language/varargs.html]Varargs[/url] | |
Re: Hopefully not a [i]real[/i] project. If so send me the site name that I know never to use it. If this is a school assignment, then, before becoming this "project" you would have been taught the things you [i]need[/i] to know, and would be expected to research and be creative … |
The End.