2,443 Posted Topics
Re: Why not simply use the vector (or an ArrayList if it does [i]need[/i] to be synchronized at that point) and then call toArray on that Vector/List? | |
Re: This S = (1/2) * perimeter; should be S = (1/2.0) * perimeter; (or something similar), otherwise (1/2) is integer math and produces 0, which makes S 0. (or simply `S = 0.5 * perimeter;` or `S = perimeter/2;`) I would also "predetermine" the value of `(180/Math.PI)` rather than actually … | |
Re: As long as an element is visible it cannot be disposed. You would have to hide (setVisible(false)) that frame before you can dispose. I don't agree with much of what you're doing here though, to tell you the truth. I find extending frmae to be a bad idea. I would … | |
Re: It's been a [i]while[/i] since I've done any [i]real[/i] scripting but shouldn't [code]if [ ! -z "$remove_old" || $n_backups -ge $MAX_BACKUPS ]; then[/code] be [code]if [ ! -z "$remove_old" -o $n_backups -ge $MAX_BACKUPS ]; then[/code] | |
Re: Nothing to do with JSP. Either you need to send all possibilites for the "destination" menu and use JavaScript to "filter" those according to the first choice, or you have to learn how to use AJAX (or something similar) [i]properly[/i]. Or, of course, you can let the entire page be … | |
Re: Seemingly it would have to be an Integer array, not an int array, although it would probably help to know exactly what "namestimesSet" is, I'm assuming a Set<Integer>. | |
Re: How have you determined that it is "being ignored"? Put a print statement in there to see. Also, you do know that after the first iteration both x0 and xn have the same value, meaning that in the second iteration 0 is not greater than .0001 and the loop exits, … | |
Re: Try using the Console class rather than Scanner. | |
Re: Okay. Finished. | |
Re: By creating an appropriate constructor in the "Purse" class. I.E [code]public Bogus(Bogus bogus) { someValue = bogus.someValue; someOtherValue = bogus.someOtherValue; }[/code] | |
Re: This [inlinecode]Product product = ProductIO.getProduct(productCode, path);[/inlinecode] probably returned null. Put in some debug output to check the values of productCode, path, and product. | |
Re: Create a List of Integers (which are the indexes to your questions) and use the random class to produce an int from zero to list.size() then get the Integer at that index from the list (and delete it) and then index into your question array using this Integer. Once the … | |
Re: [code]// the code a * b * c;[/code] That is as much cut-n-paste code as you are going to get. Post what you have, all error/compiler messages it produces, and/or the difference between the actual and expected output, and we will help [i]you[/i] correct [i]your[/i] code, but we are [i]not[/i] … | |
Re: Sure, we're happy to help, let's see what you have. IOW we will [i]not[/i] do it for you. | |
Re: No they don't. Those files won't actually be created until you open a FileWriter, FileOutputStream, etc, with them. "new File(String)" does [i]not[/i] physically create a file on the file system. | |
| |
Re: Call doLayout() on the contentPane of the Frame, and then repaint() (just to be sure). | |
Re: If you mean that the DB [i]data[/i] is to be stored on the CD, not AFAIK. If you mean only the software for the DB check out JavaDB (embedded usage). | |
Re: Because you have created a small C program using Java. Do not simply put everything in the main method. You need to essentially throw this away and start again. Create a class that holds the varying pieces of information as instance variables and that defines methods to do those operations … | |
Re: Well, that's what you're telling to do (stay the original size, that is). Try looking at the API docs for BufferedImage (and Graphics2D) and see if there is something there that can help you. | |
Re: Closing this zombie. There [i]is[/i] a "show off your project" forum here. | |
Re: [i]What[/i] exception. Add a printStacktrace to that catch block and post that result. I have a feeling, though, that's its a "classnotfound". Include the jarfile for that api on the classpath. | |
![]() | Re: Separate your GUI code from your DB code. "paintComponent" should [i]never[/i] have anything directly to do with a DB (nor should any other part of a GUI component class). |
Re: A "final" variable can only be defined [i]once[/i], and when it is static it needs to be defined at the first reference to the Class. Which means that you won't be able to use a method to set the value of a static final variable. You could use a static … | |
Re: [quote]Can not issue data manipulation statements with executeQuery()[/quote] Uhm, what do think this might mean? Look at the API docs for statement/preparedstatement and see if there is another method that is more applicable. | |
Re: Oh God, Why?, [i]Why? [b]Why?[/b][/i] [code]panel3.setLayout(null);[/code] IMHO this is the [b]worst[/b] thing that you can do. [i]Especially[/i] when you are only using standard labels and text fields. In some rare corner cases it [i]may[/i] be advantageous, but for [i]this[/i]? No! | |
Re: Well, even your comments declare that you are "ending" a class, then you continue to declare variables and methods? To which class are those to belong? | |
Re: [i]What[/i] "errors". The complete stack trace / compiler message please. | |
Re: We are not a (home)work service. Try it yourself, and post your attempt along with detailed information if it "doesn't work". | |
Re: After setting the font try calling validate() and or repaint() on the panel containing the items on which the font changes. If that still doesn't do it, then, on the component on which the font changes call component.setText(component.getText()) after setting the font and then [i]still[/i] call validate()/repaint(). | |
Re: It [i]might[/i] help to know what the error is. Also, many times, you have to actually close the connection to access before changes are committed. Acess is really [i]not[/i] suited to any kind of web application. Also, you really need to remove these scriptlets from your JSP. Scriptlets are [i]extremely[/i] … | |
Re: Java doesn't have any Swings. You find those in playgrounds with kids using them. Now, if you mean the Java Swing (note no s on the end) API, then say that. You [i]might[/i] want to post the relevant parts of your code. And, I [i]hope[/i], you are using a JDialog … | |
Re: Well, lets see. A latitude/longitude coordinate is in degrees, minutes, seconds (with decimal). 60 seconds to a minute, 60 minutes to a degree. So, first, convert your two longitudes to "absolute" numbers (i.e. (degrees * 3600) + (minutes * 60) + secs) and get the difference between the two (i.e. … | |
Re: Like any Array [code]String[] example = new String[5];[/code] | |
Re: Well, lets look at this. Your while condition is [code]while (choice2 == 1)[/code] So, in order for your while loop to "continue", choice2 needs to have [i]what[/i] value? Now, where are you "showing" your error messages? In an if statement block, right? So, what do you think you might [i]add[/i] … | |
Re: [QUOTE=JamesCherrill;1346898]Just let it put the version variable in and don't worry.[/QUOTE] Just remember, however, that if the interface of the class changes (i.e. new public/protected methods, etc) to change that number or you will have problems if the class is actually serialised as part of the app. | |
Re: Umm, peter, I thought you knew this one. ;-) [code] str = servletData.toString(); [/code] I believe should be [code] str = new String(servletData); [/code] or [code] str = new String(servletData, charset); [/code] if the "bytes" are neither ascii, nor UTF, nor the local charset. The second one (with the toByteArray()) … | |
Re: All I can say is, in the distribution instructions/readme tell the user that a mysql needs to be present. A better idea, if the DB is not suppossed to get [i]all[/i] that large, would be to distribute derby.jar with your application and simply create the DB on the fly. | |
Re: You could show some of your code. And try some debug-like print statements to see what happens, and what doesn't. And, I assume, you do not have any empty catch blocks? | |
Re: A bean? A session context object? an application context object? etc, etc, etc. | |
Re: Try [url=http://www.daniweb.com/forums/thread99132.html]here[/url]. | |
Re: Firewal, firewall, firewall. You might have opened the "phpadmin" port (whatever port that is), but you seemingly have not opened the standard DB port, and your firewall simply drops packets. Also, don't forget to properly configure your grants. | |
| |
Re: It would help to know [i]what[/i] you are actually trying to [i]acheive[/i] here, as this is [i]probably[/i] not the right way to do it. | |
Re: Put a "break" in that if statement. Or use a "while" statement. |
The End.