4,084 Posted Topics
Re: Mounika, I think it's safe to say that after 3 years, either they found the sollution, or are no longer looking anyway. | |
Re: well, you could write to several types of files. you can go for rtf, then [this](https://code.google.com/p/jrtf/) might be a good starting point. you could also store your layout information in a xml file, and use that template to generate a pdf file, containing the text you want, in the layout … | |
Re: doesn't need to be an abstract class. actually, a normal class would be better, since I doubt you would be adding abstract methods in there. just create a Scoring class, that contains all the methods that are equal for all of them, and have you YathzeeScoring/MahJongScoring/... extend that Scoring class. | |
Re: so, you just copy pasted the code you've found in a six year old thread without checking against the current version of Java... congrats. if it's due tomorrow, even the bugfixing stage should have been finished by now. you may want to organize your schedule a bit better next time. | |
Re: check [this](http://docs.oracle.com/javase/tutorial/jdbc/) | |
Re: by declaring inputCharacter outside of that if statement. the compiler will check all possibilities of that code, one is: the if statement will not be executed, hence, the inputCharacter variable is never declared, yet you do try to use it. | |
Re: I think you're making your code way to complex. first, TextReader should do nothing more then the name describes: it should read (and return) the text. nothing more. then, you have in your working class a String containing the text. use the split method to get the seperate words in … | |
Re: text-align:left; this might explain why your text isn't centered. re-read your css code for your header id. also: using classes, instead of id's is a better approach. it makes it easier to re-use them. | |
Re: castajiz_2: you may want to re-read the code snippet. as ObSys points out: if the item is found during the iteration, it doesn't return null, so "always return null" is incorrect. | |
Re: since the results are supposed to be random (roll of the dice) there is no such thing as 'expected results'. don't use if-else for iterations, use an actual loop for that: [do-while, while](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html), [for](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html) .... it's not as if you haven't got any options. using if else blocks for this, … | |
Re: how do you know it's not running? do you get an error? does it change all the textboxes? does it change the wrong one? have you tried debugging, or just adding alert messages to check what runs when? | |
Re: well, if this is the code that runs when you click, what you describe is completely normal. what you could do, is at the end of your actionPerformed execution, set the button to disabled. or, better yet, since the contents of your db may have changed, as first action of … | |
Re: 1. what kind of interface? gui? interface type? ... 2. what has your question got to do with interfaces? 3. "there were some errors" ... waaaaay to vague, please be more precise. | |
Re: you can run it as a webservice, and only provide users the code which connects to that service, so they don't have the actual .class files locally, meaning they won't be able to decompile. | |
Re: ehm ... why do you have <String, Integer> in your class definition? | |
Re: [Google](http://www.google.com) would have found [this](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html) for you in less than a minute. put some effort in it. anyway, if you don't know about this stuff, I would recommend against going to job interviews for Java development positions. | |
Re: ehm ... you don't "have to", not according to Java anyway, maybe it's a part of the exercise you are reading? anyway, the following code: String s = "asdf"; String s = new String("asdf"); would not compile, since you are declaring two variables with an identical name. maybe the book … | |
Re: I don't see how you would do that. what you could do, is first read in all the elements, so that you will be able to sort them, and then add the contents as items to your list. | |
Re: you're getting an error on line 198 and you think we know what that line does (wrong) by only showing us 38 lines? | |
Re: personally, I don't really see the point of this. not to mention, you risk a lot of overhead. what you could do is to use cookies. when you login, you store your username and "logged in", or better yet, a timestamp, which you update while you're on the webpage. when … | |
Re: wonderthegreat: this thread is years old. if they haven't got it to work yet, I doubt they ever will. | |
Re: they need to be in two seperate java files with their own names (equal to the name of the public class). you can do it in one, but then you need one of the classes not to be public. also: don't forget the closing brackets for your classes. don't create … | |
Re: try and stick to the naming convention, it 'll make your code easier to read. "it doesn't work", is a very vague description. has it ever occured to you that maybe the record you are looking for doesn't exist? there are quite some reasons why this might go wrong. did … | |
Re: seems to me you are looking for 'OrderNo' while you should be looking for 'orderNo'. your method is 'getOrderNo()', the name you should use is that methodname, without the get, starting with a lower case. | |
Re: since it extends the class public server(){ desk. ... } should do the trick. make sure it's instantiated first, though, meaning your run method must run before your server constructor (which is not possible) or you must instantiate your desk variable in your server constructor | |
Re: "the other method doesn't work".... 1. read the file's lines into a resultset 2. while line != null -> line = resultset.nextLine(); add line into arraylist >> this is the logic for reading >> start with the arraylist, to which you've made the changes write it to the txt file … | |
Re: that would depend on the datatype. he can go and use the Integer wrapper class, instead of the int type. that way the default value will be null. after entering the values, he can simply replace the 0 valued ones by null as well. | |
Re: there is no "best answer" there's just the answer. the throws keyword is used in the signature of a/the method, to indicate that it might throw a certain type of Exception, forcing all the methods that call this method, to either implement some exception handling, or to throw the exception … | |
Re: notepad? it's basically just a textfile which you give the extension .properties | |
Re: "chipping people for better intelligence"? IMHO, if you allow yourself to be "chipped" like that, you've already proven you'll never reach 'better intelligence' anyway. the human mind and brain make quite the pair, and they do a pretty good job on their own. ok, you'll have to do some effort … | |
Re: ehm ... a JTextArea has a certain text, not lines of text. if it's flat text in there, without an indication of where a line ends, you can't just search line by line afaik. | |
Re: take a look at the sticky threads on top of the java forum, they're meant to give beginners advice on what to begin with and where to find that information. | |
Re: seems like this has become a spamfest. | |
Re: http://stackoverflow.com/questions/5016326/make-text-box-editable-using-javascript | |
Re: I'm a bit lost here... what exactly do you want as output in your JTextField? | |
Re: you believe the answer is ... and what IS the answer?? | |
Re: Sanjana.reddy.5201: this thread is several years old, it's doubtfull the OP is still following it. | |
Re: you need to realize that "A N Other" is not a numerical value, hence can not be casted to a number, which is what you are trying to do on line 13. go over the logic step by step, and either re-think your code, or your input. | |
Re: only trolls? is that why you are on it? has it occured to you that maybe nobody replied because you're description was way to vague? my guess, starting a thread which is defined in the main class, and pausing or stopping it when clicking it on the second button. do … | |
Re: this is not a "code on demand" forum. the caesar cipher is very easy to code in Java. how about first giving it a try, and then if it doesn't work, show us what you've done, and explaining where it goes wrong. | |
Re: did you notice those posts are years old? there 's no reason te revive dead threads. it's better to create your own. | |
Re: what do you mean, you don't know how to input the data? it's you who should know. anyway, there are different ways. if you are using a command prompt, you can use a Scanner to read the input, and a loop to iterate over the different students. you could also … | |
| |
Re: somehow, I doubt your JComboBox to refresh. the code you posted here won't even compile, since you are using variables you don't declare. | |
Re: actually, yes, it is. it is a static member of the Font class: http://docs.oracle.com/javase/7/docs/api/java/awt/Font.html#PLAIN | |
Re: why exactly do you not group your radiobuttons? are they both supposed to be checkable at simultaneously? then maybe checkboxes are more suited. users might assume that only one of your radiobuttons might be selected. |
The End.