4,084 Posted Topics
Re: what is the result you expect? what is the result you get? are there any error messages? does it compile? does it run? .... ? | |
Re: > At least it's better than getting downvoted because someone doesn't share your opinion on something, without any factual data to counter your argument. which happens quite a lot, in which is not the worst reason people use to downvote. if you downvote someone, and explain in comment why, if … | |
Re: I might be a bit picky, but what exactly has this to do with "inheritance/interfaces", as you state in your title? might have overlooked it, but I didn't see the interface, and most of your methods are static, which means they aren't inherited anyway. also: a tip on code design, … | |
Re: that is because Java, by default, supports wav, but it doesn't support mp3. if you want to play mp3 files, there are a few ways you can go: 1. the Java Media Framework (JMF), which is no longer supported and was, in my opinion, quite a pain to work with. … | |
Re: you are reading int input and are treating it as booleans. that's not how it works. // about your first attempt. for the rest. .. we don't know what you pass as parameter, so how would we know what's going on? | |
Re: well, if you can use JFileChooser, I just must assume you've heard of mutators (setters/getters) before? using those, you can "pass" values from one class to another. | |
Re: so ... what exactly did you expect? if the current (now yesterdays) date is in your db, that result is correct. | |
Re: one of the main reasons Windows 8 is getting "very popular", is because a lot of computers and laptops alike are sold with it pre-installed. that doesn't really make it a good OS. sure, it has a benefit of being able to work with a lot of software that isn't … | |
Re: read up on JFileChooser. look [here](http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html) | |
Re: ehm ... what do you mean "too"? don't really consider myself to be a geek :) | |
Re: as to 'how is Java platform independent', since my guess is that's your actual question. for each platform there is a different JRE, which handles the differences. so the code you write/compile, won't have to be re-compiled, you just need to have the right JRE installed on the system where … | |
Re: you may want to re-think some of the logic in there. if (Double.parseDouble(num)==0) { System.out.println("Number is cero"); if (Double.parseDouble(num)%2==0) { System.out.println("Number is even"); } else { System.out.println("Number is odd"); } } see the logical error there? in the first code you've provided, you've forgotten the possibility of a negative number. … | |
Re: showing how might benefit the next person who encounters this problem. | |
Re: and make sure the OP is clear about what he wants: a lot of people tend to mix up web developer and web designer. | |
Re: if (user.length()==0) { System.out.println("Please insert a valid member"); } wouldn't while ( user.length() == 0 ){ System.out.println("Please insert a valid member"); } or while ( user.isEmpty()){ System.out.println("Please insert a valid member"); } be better? now, I don't really know about this: > /*For some stupid reason, Java is stupid (no … | |
Re: then cast them to the format you need. what exactly is the problem? | |
Re: and what exactly is your question? it's clear you need a lot of additonal info on static and instance methods. actually, what you are asking for.. you're already doing.- (almost) you have declared the return value as an array of Strings.. set it to a simple String. | |
Re: what do you mean "do not have a window"? what is it exactly you are trying to do, and what do those actions do? without knowing the code of those classes, it's pretty difficult to check what's actually going on. | |
Re: by writing the code as such... without more explanation, that's about all the help I can give. | |
Re: not to mention that this is not a 'project', it 's about a single conditional statement. | |
Re: do you have a 'Disk' class? you're not giving enough information for us to get everything. | |
Re: is that an error message you made yourself, or is that the message printed in the stacktrace? [FileUtils](http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html#copyDirectory(java.io.File, java.io.File)) | |
Re: what do you need that for anyway? a better way would be to have your id set as "auto increment". no need for the developer to "calculate" the next id, if the db can do all of that for you. | |
Re: well, I'm not going through all of that NetBeans generated Swing "code", but what I think you are looking for is not showing a new JFrame, rather hiding the current JPanel that is shown, and show another one, that is placed on the exact same coordinates, but was hidden as … | |
Re: ok... and what problem do you have with that? considering the fact that it's a jsp question [this forum](http://www.daniweb.com/web-development/jsp/24) is a more suitable place to post it, but I suggest you provide just a bit more information: * do you achieve to get the values * what are you / … | |
Re: [Oracle on servlets](http://www.oracle.com/technetwork/java/index-jsp-135475.html) basically, Servlets are classes that extends HttpServlet and that can be used (in combination with jsp) to create webapplications. if you want to learn more about them, I would recommend [this book](http://shop.oreilly.com/product/9780596516680.do). if you start creating them, questions might be quicker answered in [this forum](http://www.daniweb.com/web-development/jsp/24). | |
Re: depending on your experience, start of with the universal basics, like pseudocode and, if you want to start using an object oriented language (without having used one before) read on about the principles of object oriented programming | |
Re: without seeing your actual code, and without knowing what it is you enter as input, it might be a bit difficult to see what you are doing wrong. | |
Re: try Googling from time to time, I'm pretty sure you would 've found [this](http://stackoverflow.com/questions/10523382/how-can-i-get-the-current-user-in-liferay) | |
Re: check whether z is 0, if so, and your 'keys' is not a letter (it might come in handy to use the getKeyChar() method instead of the getKeyCode() method) so ... if this char is not a letter, don't add it to username, don't increase the value of z and … | |
Re: sure we can do that, but char is a primitive type, you are trying to treat it as an instance of a class, which it isn't. | |
Re: setters and getters can also help you improve encapsulation in your classes. let's say you have a class 'Person', with age as variable (an int). if it's not set as private, you can put any value there. ever seen a Person that's negative 200 years old? but, with setters, you … | |
Re: but myarray having a 0 length is not really "impossible", so throwing an error or exception, might not be the best idea. | |
Re: @radhakrishna.p: sure you can create an inner class like that. | |
Re: also, that is not always the case. tons of web-apps are written in Java, and they don't start with (don't even have) a main method. the main method is for desktop and stand alone applications the entry point for your application. it's a bit the same as asking: "when someone … | |
Re: you could also show here what you've implemented... for instance like: do{ // ... previous code (you don't have to copy paste all of that readInputForTest } while (test==1) that might help us to see what's wrong with it. | |
Re: are you talking about [this](http://docs.oracle.com/javaee/1.3/api/javax/servlet/jsp/tagext/Tag.html) one? | |
Re: by reading up on the algorithm and writing the code. [Bubble sort](http://en.wikipedia.org/wiki/Bubble_sort) | |
Re: and ... why not make the constructor private? if the constructor is not private, what's to stop us from creating multiple instances? | |
Re: true, her politics caused trouble for a lot of people, but ... then again .... no offence, but look around. in the UK there's this one workless guy, has 17 kids with about as many (15) different women, and he lives on child support. now, lately, the guy has murdered … | |
Re: > it won't work is pretty vague. what's the code for undo? | |
Re: that's because they're not of the same type. just check the api for the [JList](http://docs.oracle.com/javase/7/docs/api/javax/swing/JList.html) and check what you can use there. | |
Re: 1. if you are just starting with Java, for now, stick with console applications and learn the language 2. do yourself a favour and do not use the NetBeans Swing editor. it generates hard-to-read-harder-to-maintain code that can be described as "crap". the worst of it is: you don't learn to … | |
Re: you get a NullPointerException. I assume you know what that is and when that's thrown? unfortunately, since the line the exception points to, doesn't exist in the code you show, so maybe you have a number of breaks in the file that aren't here? a few pointers though: don't use … | |
Re: what you are writing seems to me more a mix between pseudo code and actual code. IMHO, if you stick to regular pseudo code, it'll be easier to write the code for the game. | |
Re: G_S ... your explanation of 2 makes no sense at all. what exactly are you trying to say there? for your point 3 - since we don't know what your teacher did, we can't really answer that. we also haven't seen any of your code, so we can't really comment … | |
Re: you are reading "this book"? hmmm ... let me just see if I have "this book" available right here. if that book is any decent all you need to know is either explained in there, or is listed as requirement before starting with it. most likely, it's explained, since getting … | |
Re: have you checked the other methods available in SimpleDateFormat? | |
Re: somehow I think the question is more related to: how do I add an action to my buttons, and call it by clicking on them? | |
Re: this is about eight lines of code, and that includes lines with only a bracket. what have you got so far? |
The End.