4,084 Posted Topics
Re: why did you create an exe file in the first place? do you have issues with non-Windows OS? :) | |
Re: looking at the sticky thread on top of the java forum could help you out. it's purpose is to show what books/ ... can help you start with (learning) java. | |
Re: inner classes ... network communication ... passing references of the frames to each other ... keeping references to all frames in the parent class, and allow those to be accessed by every client ... tons of ways you can do this, depending on what you have to keep in mind: … | |
Re: well you'll have to take into account all possible costs: if those pc's fail, do you have to go there for support? if that client is two doors down the road, no problem, but if that client is half way 'cross the country, that might cost you a bit. are … | |
Re: and what problem are you having? since we don't know what you are passing to this jsp page, how do you want us to check if it works or not? | |
Re: in a command prompt? don't think that's possible. | |
Re: well, you still are passing 0 as a parameter, since that constructor shouldn't take a speed parameter, that's wrong. how did you change your car code, how did you change your main method and what is the exact error message you get? | |
Re: move your [Code=Java] int count = 0; [/Code] to right before the move method. you are resetting the value each time you call that method, that's your problem. | |
Re: [QUOTE=NormR1;1779850]You can initialize an array in one statement: int[] term = new int[]{7, 15, 30};[/QUOTE] or shorter: [Code=Java] int[] term = {7,15,30}; [/Code] | |
![]() | Re: having your application perform a task by clicking a button can easily be done by using [URL="http://docs.oracle.com/javase/6/docs/api/java/awt/event/ActionListener.html"]ActionListener[/URL]. there are other Listeners that can help you out as well, so no, I'm not saying this solution is 'the one and only' |
Re: server side, or client side... with a bit of javascript you can have a bit of a dynamic touch. but there is need to scripting, that part is right. | |
Re: [Code=Java] Frame2 newScreen = new Frame2(); newScreen.setVisible(true); [/Code] you mean something like that? | |
Re: [QUOTE=zeroliken;1780351]make a program that reads the metadata of the selected mp3 file Here's a link that might help; [URL="http://stackoverflow.com/questions/1645803/how-to-read-mp3-file-tags"]http://stackoverflow.com/questions/1645803/how-to-read-mp3-file-tags[/URL][/QUOTE] did your reply come before the original post??? so, the Morpheus was right. we've found the Chosen One :D | |
Re: honestly, I have no idea of what you are doing, or why I should automatically assume why p * r should be the correct answer. could you elaborate a bit more? | |
Re: why would you want an .exe to install a .jar file? you would ruin the entire platform independent advantage you get from actually using .jar files | |
Re: [Code=JavaScript] if (time < ) [/Code] this is ... well, pretty bad. "if time smaller than ..." smaller than what? you need to actually compare it to something. just check this code and adjust yours to what you need: [Code=JavaScript] <html> <body> <script type="text/javascript"> var d = new Date(); var … | |
Re: personally, having the knowledge needed to get the certification is way more important than having the actual certification, and, being able to put it to good use, will make an application even more interesting in the eyes of the recruiter. I have the first Java certificate by Oracle, but believe … | |
Re: Why can't you do it for decimal numbers? the logic is about the same, but you'll just need to accept a numeric type that is capable of taking decimal numbers, like float or double, and take into consideration the number of leading zeroes in your decimal part, too. | |
Re: maxinville, this question is a bit weird, in my eyes. you either have copied that code from somewhere, or you are capable of getting information from a DB. say you have a class User => that has two Strings, userName, password. => that has one constructor which takes both Strings … | |
Re: call stop before changing the track. | |
Re: 'any of the constructors' ... ? do you know what a constructor is? I hope you do know you only have one constructor there. create a 'addSom' method which takes a double as a parameter and has either void or boolean as returnValue. void (since you don't really need a … | |
Re: it means you have a null value somewhere in your code. that stacktrace tells you exactly on what line in which class. check that line, add some print statements to check what value is null, and change your code to make it impossible for a null value to appear there, … | |
Re: [QUOTE=skilly;1729547]how many? Will I.T. survive?[/QUOTE] are you kidding? when the meteor crashes, the sun toasts us all, they finally drop 'the bomb', there'll be nothing but cockroaches. And possibly Windows OS, but, when I think of it ... Aren't they related somehow? :) | |
Re: there is no such thing as a JFrame function the way you describe it, you mean to say a Java desktop application which has a Swing GUI. first, you'll need to check for yourself, how deep and correctly you're willing to go: for instance: 2 + 6 * 3 = … | |
Re: nice code. 1. add code tags 2. do understand you did not provide us of a schedule of your DB, which is where your problem lies. an invalid column index is something what may occur if you ask for the contents of the fourth column, if your table only has … | |
Re: over a year old? I think your watch is running a bit fast :) | |
Re: what do you mean by different numbers? and why do you do this: [Code=Java] Thread task1 = new Thread(new SleepThread("task1")); [/Code] instead of [Code=Java] SleepThread task1 = new SleepThread("task1"); [/Code] ? | |
Re: well ... one way is to do it in a thread. first time you click => start next time you click => sleep | |
Re: just giving a possible solution, will be a lot better out there. remember, when you are writing a 'line' into your file, you're actually writing a String object (it's contents anyway) that you have stored in your memory. it may not be very easy to 'format' the contents of a … | |
Re: you're trying to 'stop' a different AudioStream then the one you've 'start'ed. [Code=Java] AudioStream as = new AudioStream(blah); AudioPlayer.player.start(as); [/Code] this is the audiostream you are playing, so it would be this particular stream you would have to stop. [Code=Java] AudioStream as = new AudioStream(blah); AudioPlayer.player.stop(as); [/Code] this stream, even … | |
Re: you could also try: [Code=Java] int count = 0; String test = "my1stStringwith2Digits"; // count should return 2 : 1 & 2 for ( int i = 0; i < test.length(); i++){ if ( Character.isDigit(test.charAt(i)) count += 1; } System.out.println("Count = " + count); [/Code] but .. just a question. … | |
Re: you could start playing with the layouts. there is a null layout too, in which you specifiy every detail about your components, for instance, if you have a JTextField, you specifiy the location of the 4 points that decide the height and width. coding like that might solve your issue. | |
Re: well ... certifications are good if your in between projects and don't want a gap on your resume. for a starter, it might help, since (for instance) the OCJP certificate goes in deeper to the Java basics than some college courses do, but in the end, experience beats certificate, it's … | |
Re: it's because your other variables are doubles. this basically means they accept decimal values, but an int doesn't. so, in 0,03 * 1,25 = ... you would get: 0 as result, because of just that, your precision levels are different, it's like converting a .png image to a .jpg, less … | |
Re: well, what you can do is take a screenshot, and take a transparent picture of a cursor and add it to the printscreen :) | |
Re: [QUOTE=tatsuya;1777960]in confused what promgram i will copy, can somebody write this program again? so that i will know what program i will use[/QUOTE] what program you are going to copy? how about 'none', write your own. about everyone here can re-write this application, but why should we? we don't need … | |
Re: depends, what JDK have you installed? using switch-case on String objects has only been implemented since Java 7 if you work with a previous version, you can always keep a String array of the possible answers and use the index as switch value. | |
Re: that means that you will augment the value of the i variable in your v2 in your fd1 after executing that line. | |
Re: emmm ... what do you mean? just tested your code here and the quiz starts, so what do you mean, nothing happens? | |
Re: [QUOTE=Philippe.Lahaie;1776903]simply change your while condition, so that instead, you do the rs.next() in a if, so if .next returns false then you can launch say a JOption pane in the else section. then after the whole process lauch a confirm dialog and loop the while on the dialog result [CODE] … | |
Re: show your main method (or where you call/use your class). also, I think you're getting a few logical errors there: [Code=Java] public Money(int pounds) { // To get the total pence from the input amount _totalPence= pounds; _currency = "£"; } /** * Create an amount of money in pounds … | |
Re: yes, you are stacking up. you should have your while and your call to playAgain(); in the place(method) where you originally call playAgain. | |
Re: your class needs to extends JPanel or JFrame in order to add a JTextField | |
Re: in which case, you could have done a better job on your DB. but if I'm correct, you have a table with (for instance) "385" (element 1) "21" (element 2) "128" (element 3) and you want to sort it so, that it becomes "21" (element 1) "128" (element 2) "385" … | |
Re: no. that link is ment for "starting with Java", which is the main reason it's called "Starting java". there is no 'quick & easy' way to learn how to code. it's not just about knowing a bit about the syntax, you'll also need to understand the logic behind it all, … | |
Re: see if you can get hold of [URL="http://shop.oreilly.com/product/9780596005405.do"]this[/URL] | |
Re: br.readLine() here you are reading a line of text, but you're not doing anything with it. store the result of that method in a String object, while ( result != null ){ // this will iterate as long as there are lines to read } you could have a lot … | |
Re: what kind of sorting do you want. what trouble are you having coding it? a very good way to start is researching what a sorting algorithm does, and write out an example on a piece of paper: [URL="http://en.wikipedia.org/wiki/Bubble_sort"]here[/URL] for instance, you'll find all the logic for Bubble Sort (including pseudocode) … | |
Re: why would you want to do that? it's not correct and your course class already has that information. that arrayList is stored in the Student objects you have in your studentList ArrayList |
The End.