2,443 Posted Topics
Re: What exactly is it you want to print? At the moment you are printing only empty lines. If you actually want to print something, don't you think you should be inserting something into those println statements? | |
Re: see the man pages for the find command. | |
Re: What did you use to write your file? Because if your file were the simple text you claim it to be, you wouldn't be getting that. Tell you what, open notepad (or vi on a unix system) and open the file with that, and see of you see the same … | |
Re: So what did you not understand about his post? Read the API docs for KeyListener. | |
Re: I believe the result of the paint method (i.e. the actual changing of the picture seen on the screen) doesn't occur until the paint method returns. Which means, playing the sound inside the paint method will ensure that the sound is played first. I could be completely off-base, but I … | |
Re: Actually, it would be that he never told appletviewer which applet he wanted to view (although your information is good information, he never even got this far). You need to create a very small static html page that contains a reference to your applet, then run appletviewer as follows [code] … | |
Re: It means your script is suppossed to delete the files, but rather than actually deleting them, you will simply tar-gzip them and move them somewhere else. Essentially the "trash bin" process. | |
Re: What problem are you having with it? | |
Re: Did you compile those two exception classes before compiling the other and did you use "-cp ." on the command line? Also, why extend RuntimeException and then declare the methods to throw those exceptions? RuntimeExceptions are unchecked excpetions, they are not suppossed to be caught (although they can be), and … | |
Re: No. Write two methods. One that takes a String as an parameter, and one that takes an int as a parameter. If you feel you must do it this way, then Google for "Java instanceof". | |
Re: Open two FileOutputStreams and add an [code] if (Integer.parseInt(line) > 0) [/code] [url]http://java.sun.com/javase/6/docs/api/index.html[/url] [url]http://java.sun.com/docs/books/tutorial/essential/io/index.html[/url] | |
Re: That is JavaScript. JSP cannot affect the loaded form without a submit and reload, as it runs only on the server and the loaded page is completely on the client. | |
Re: Well, looks as though he successfully fooled you with his homework/test question. | |
Re: null has no type. It would have a vague type determined by whatever type the argument it was passed in as was suppossed to have. And I say vague, because it would be determinable, because the method already knows it's suppossed to be of that type. Also, how would propose … | |
Re: Well, what do you have and what error/compiler messages is it producing? We are not simply going to do it for you. | |
Re: try it, post it, and we will help to correct it | |
Re: [code] SELECT name, SUM(liters), SUM(amount) FROM salemast GROUP BY name ORDER BY name [/code] | |
Re: Uuuuhhhhmmmm, then why ask this in the Java Forum. I've already asked the mods to move this thread to the proper forum. | |
Re: Well, we don't know what information you're including in your project either. | |
Re: [url]http://java.sun.com/javase/6/docs/[/url] Contains links to suns tutorials and the api docs, as well as jvm specs and the jls and a features guide. In short, Suns official Java documentation. | |
Re: And this [quote] I am programming using a Java Editor called "TextMate" on the mac and it often gives me errors that I don't get when I compile using TextPad on the Windows machines at school. Can someone check if this compiles on a Windows machine please? [/quote] is obviously … | |
Re: Because, of course, you're suppossed to provide all of that. Why else would he post here, if he still had to do any of it himself? ;) | |
Re: A "batch" file, as in a windows script, or a unix shell script. If the first option, then you asking in the wrong forum. | |
Re: [QUOTE=javaAddict;692284]By the way, I don't agree with the way the ParserException is written. This is not the right way to extend the Exception class[/QUOTE] To tell you the truth, after your post I decided to give a quick look at the code, and you know what, I don't agree with … | |
Re: First of all, you should use [code] ps -ef | grep bash | grep -v grep [/code] otherwise you sometimes get the process for "grep bash" as well. Also, "$2" in a ps -ef command is the ProcessId, not the memory usage. The memory usage is not printed at all … | |
Re: You make it [code] } while (employee.equals("")); [/code] and then evaluate the additional "20 errors". The thing about the compiler is, it makes multiple passes through a code file, and if one pass finds an error, it will finish that pass, but not even attempt to make the other passes. … | |
Re: [QUOTE=Easter Bunny;690775]also (this won't change the way the program functions), instead of saying "day = --day", you can say "day--".[/QUOTE] Yes, that will change the way the program works. prefix is evaluated before the variable is used and postfix is evalutaed after. i.e. [code] int i = 5; int j … | |
Re: Where in this part of the code have you defined Clock. [code] Stopwatch Clock; switch(c) { case 1: Clock.Start();break; case 2: Clock.Stop();break; case 3: Clock.Reset();break; case 4: Clock.Display();break; } //end of switch for calling stopwatch [/code] | |
Re: [QUOTE=stephen84s;689636]You have not set the layout for your JFrame, and so it is using the FlowLayout.[/QUOTE] Uhmmmm, I believe the contentPanes of the top-level windows use BorderLayout, but that's beside the fact. | |
Re: [QUOTE=Ezzaral;683763]Yes.[/QUOTE] I feel I need to qualify this remark. That method should be final, because if someone extends your class, you will probably wind up with unexpected (and quite probably, for your class, catastrophic) effects if the method called from the constructor is overridden, as the overridden method would be … | |
Re: There is no direct way to "clear the screen" (except printing out a bunch of blank lines), and yes there is something to the effect of system("COMMAND"); Check out the Runtime and/or ProcessBuilder classes. But the advice by jwenting is correct. | |
Re: [QUOTE=Ezzaral;689048][code]new SearchResult(String s).setVisible(true);[/code]Read any reference at all on Java and you will see that this is not the correct way to call a method. Method calls do not include the type with the parameter. This is HelloWorld-level basic language semantics. I would recommend reading a lot of this: [url]http://www.codeguru.com/java/tij/[/url][/QUOTE] So … | |
Re: Loop until you have a valid value. i.e. [code] String s; while ((s==null) || s.equals("")) { s = JOptionPane.showInputDialog("Enter a simple infix expression: "); } [/code] Although you will have to define the parameters, that is just an example. | |
Re: Use SimpleDateFormat to parse the entered info into a Date object, rather than making any assumptions about the numerical value of any month. 0-11 is how it stands now, on nearly every system, but they do not have to have those values. That is why Classes like SimpleDateFormat exist and … | |
Re: One thing I see is [code] ImageIcon mybg = new ImageIcon(ClassLoader.getSystemResource(theUploadType+"Icon.jpg")); [/code] Is this "Icon" contained inside the jarfile? If so, you cannot use this form of the constructor. You will want to use getResourceAsStream together with ImageIO.read(InputStream) to create a BufferedImage, then ImageIcon(Image) constructor. | |
Re: Áre you talking about a SplashScreen (Google Java SplashScreen) | |
Re: Look at your constructors. You have a constructor that takes as arguments String, String, char, boolean, Course, Course but you are calling the constructor with String, String, char, boolean, int, int See the problem? | |
Re: The garbage collector is called by the JVM whenever it is needed, and possibly periodically, otherwise. The gc() method is simply a request to the JVM to call the GarbageCollector, but ionly that, a request. It does not guarantee that the GarbageCollector [i]will[/i] be run, or, if it is, that … | |
Re: Thread's start method calls run. The scheduling is handled by the OS (AFAIK). | |
Re: equals and toString exist in the Object class (which all Classes implicitly extend), so the class [i]does[/i] implement them. Also, == , when it comes to objects, compares there reference values (i.e. are they the same actual object). It does [i]not[/i] compare there content (i.e. do they both contain the … | |
Re: See, javaAddict. That's all this guy is looking for, a free ride. | |
Re: "dd/MM/yyyy" not "dd/mm/yyyy" Case makes a difference (m is minutes in hour, not month in year). See [url]http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html[/url] Always read the API docs for the class in question, first. | |
Re: Find a JavaScript forum. Java[i]Script[/i] != Java. Nevermind, I've already alerted the admins to simply move this thread to the JavaScript forum here. | |
Re: No. We are not going to do your (home)work for you. If you have a [i]specific[/i] question ask it, and we will attempt to answer it for you, but we are [b]not[/b], as already said, going to do it for you. | |
Re: Insert the cd and reboot. (And make sure that cd comes before harddisk in your boot order.) | |
| |
Re: To tell you the truth, these are not JSP questions. The first one is an HTML/JavaScript question (you will simply "echo" that out in the JSP). The second one is an image editing question. | |
Re: Seeing your code [i]might[/i] help, however I can take a couple of guesses. 1. You haven't done pack() before doing setVisible(true) 2. You are "playing" the animation in the vent thread, thereby delaying/preventing the operation of the GUI |
The End.