4,084 Posted Topics
Re: I think [CODE=Java]javax.swing. [/CODE] should be [CODE=Java]javax.swing.*; [/CODE] | |
Re: you might want to elaborate a bit ... for instance, what is it you think your code should be doing, and I don't mean the original assignment, because I can tell from miles away you haven't got any input in there, if that's the question. ask more specific, like, why … | |
Re: if you're a beginner, you might want to start with some easier tasks. I haven't try this for myself, but I think the next sollution might work. you get an array of results from your db, which means you know how many checkboxes you need. so, you create an array … | |
Re: in order to run, you 'll have to put code in your main method. but your getEmployee method in that main class won't do you any good [Code=Java] Employee newEmp = new Employee(); /* this creates a new instance of the class Employee when you now use the getters on … | |
Re: uhm .. pass the name as a parameter?? | |
Re: use nested loops, they work exactly the same as normal loops. here's a bit the logic to go: while newInput = true{ inputNumber = ? while not numerIc(inputNumber){ inputNumber = ? } processInputNumber newInput = ? => true or false } | |
Re: hate to be thát guy and all, but sometimes it's needed for the message to get through you don't put those formula as input, you put them as text in the JOptionPane box and you get the pupils answer as returned input. quite easy. all you have to do, is … | |
Re: what do you mean? your jar file to have another icon? your frame to have another icon in the bar on top of it??? | |
Re: could you give some more info on which dialogbox what you want it to do what it is/isn't doing ? | |
Re: how do you know it's doing something wrong? what is your expected output and what do you get? which error messages do you get? | |
Re: [QUOTE=mclovin tonite;1150693]This avoids a nullPointerException [CODE]public void get(String text) { boolean loop; do{ loop = false; try { input = JOptionPane.showInputDialog(null,text,title,JOptionPane.PLAIN_MESSAGE).toLowerCase(); } catch(Exception e) { message("Don't hit that CANCEL BUTTON!"); } }while(loop); }[/CODE][/QUOTE] there isn't need to revive a thread that was marked "solved" over a year ago | |
Re: here's a thought: [URL="http://lmgtfy.org/?q=java+%2B+%22write+file%22+%2B+example"]Click me[/URL] | |
Re: [QUOTE=pfuturama;1150657]can anyone explain with me briefly of instance variables and local variables.[/QUOTE] any basic course of java would do that ... instance variables are variables that you store in Objects, and can modify or use, by using the setters and getters. local variables are used locally only, they can only … | |
Re: if you don't know what inner classes are, I doubt you're using them. in which case, I would recommend you to follow JWentings advice: DO NOT put two classes in one single Java file | |
Re: [QUOTE=smith!;1148868]hi there i really need help to write a java program on this i dont understand anything in java plzz i need help. ive put and attachment on so people could have a look at it. thanks [ATTACH]13921[/ATTACH][/QUOTE] let me guess ... you just attached your assignment in here, didn't … | |
Re: you'll need to place the return statement outside of the for-loop, for starters. if your collection has more than one element in it, your goal seem to be to return an array of booleans, if your collection has no elements, the return statement wouldn't be reached (if it were a … | |
Re: [QUOTE=JuneM;1148198]This is different... and I think I am not bothering anyone by submitting a new thread in my acount here. If you don't want to help, you don't have to reply to my thread. thanks[/QUOTE] actually, Ezzaral is helping, and he is right: the sollution to this problem is mentioned … | |
Re: [QUOTE=hikma;1148140]i just wanna full code of java in store management system[/QUOTE] and I just want 5 million € .. just to dot the i's here: 1. we will NOT do your work for you 2. we do NOT appreciate lazy persons that expect other people to do their work to … | |
Re: if they're really interesting, they would've given you some explanation of what exactly it does .. reading that could help you out a lot, but as stated before, I think you're better of actually working than just following a lot of courses without knowing you're going to need it afterwards | |
Re: what you also can do, is put the factions and such into arrays of Strings, determine the location for each in the array, and use that to write a Switch-case statement. not necessary more efficiënt, but easier to read if there are a lot of options | |
Re: please start a new thread and provide some more information, your code, for instance. don't keep reviving threads that (should 've) ended years ago | |
Re: [QUOTE=acid13burn24;1145982] can you help me to do the atm program,?[/QUOTE] there is no "thé" atm program [QUOTE=acid13burn24;1145982] can you share the codes??[/QUOTE] no [QUOTE=acid13burn24;1145982] thanks a lot..[/QUOTE] you're welcome | |
Re: even if ... try to use code tags .. ain't even thinking of reading it like this | |
Re: [QUOTE=rocky89;1143569]Another interesting type of number is known as a perfect number. A perfect number is one for which the sum of its divisors (excluding the number) is equal to the number itself. For examples 6 is perfect since the three divisors of 6 (excluding 6) are 1, 2, and 3 … | |
Re: or try reading the date .. it was homework of september 2009, I doubt he still cares | |
Re: have you written anything yourself? you'll have to use Swing, and quite basic programming logic ... show some effort and it 'll be easier for us to guide you through the rest | |
Re: indeed, you'll need a loop to keep your program running if you want it to repeat, but it is best (and easier to read) if you put your menu and the accepting of input in a seperate method, which you call when needed. for instance: [Code=Java] package project; import java.util.*; … | |
Re: no offence, but if you can't write a single for loop, create and initialize an array and print their values by the time your mid term is approaching, maybe you should consider either choosing another major, or stepping up the studying a bit. in cases like this, it is way … | |
Re: try [Code=Java] if( costKwhrField.getText().equals("")) [/Code] | |
Re: there are different ways to do this, but since you say you're in the early stage of learning, don't try to do it all at once.. for instance, you could do it by a simple loop without the mathematical stuff, for instance. [Code=Java] int total = 0; int number = … | |
Re: use [Code=Java] System.out.print("to print"); [/Code] instead of [Code=Java] System.out.println("to print"); [/Code] | |
| |
Re: you might want to take a look at [URL="http://www.jdom.org/"]this[/URL]. it's written in Java and it deals with creating, editing, ... xml files in Java | |
Re: by addressing the correct jdbc drivers, and using the correct code while passing on the correct information, such as username and password. whether or not your program uses properties files has nothing to do with the accessing of a database. you might want to take a look at [URL="http://java.sun.com/docs/books/tutorial/jdbc/"]this[/URL] site, … | |
Re: somehow I doubt that you'll need to extend Time2 in Date, since Data will on no moment use the methods or variables provided in Time2. I think you're more looking at something like: [Code=Java] public class DateAndTime{ private Date date; private Time2 time; public DateAndTime(){ date = new Date(1,1,2001); time … | |
Re: if you're still a beginner, connecting to databases might not be the best place to start. anyway, how to connect depends on several things, what kind of database, is there a password, ... and since you don't tell anything about that, I'm not going on a wild goose chase. the … | |
Re: [QUOTE=shweta74;1121873]Hi i m having problem in java for passing value from one frame to another.Please kindly do help me..................................[/QUOTE] and this has what to do with the previous posts? either stay on topic, or start a new thread | |
Re: the while loop finishes at the first semi-colon, unless you put your statements between brackets. so [Code=Java] while ( condition ); loopThis; [/Code] loopThis; is outside the while, because you've placed a semi-colon right after the while condition the same with [Code=Java] while (condition ); { loopThis; } [/Code] loopThis; … | |
Re: could you paste your java code here as well? | |
Re: for all in this thread: type English, not sms abbreviations. next, try and do some thinking/analysing/programming for yourself we are willing to help you, but we won't just hand out custom made software, especially not without effort from your side | |
Re: [QUOTE=musthafa.aj;1117566]this is error free code check it.. and product class you need to import ..... [CODE] public void setItemTotal(int total) { itemTotal = ( total = 9 ); }[/CODE][/QUOTE] define "error free". @ Rmj001: are you trying to assign a boolean value to an integer, or did I miss something? | |
Re: don't just feed him code ... it's like the "give a man a fish, or teach him to catch 'm" principle.. he already knew how to prompt for one value ... you could 've told him to put it in a loop. the code you gave him will allow him … | |
Re: [QUOTE=verruckt24;1116921]Apart from the mistake mentioned by the adatapost, here's another: [CODE]public void Pitch (String types);[/CODE] that appears to be a method without definition, remove the semicolon at the end of the line.[/QUOTE] ehm... why? it's an interface, so that code is correct | |
Re: [QUOTE=Katherine692008;542239]It's working great. Thanks When I enter non numerical digits I get the error message [COLOR="Green"] "parseInt function failed" [/COLOR] How would it be possible to get the error mesage [COLOR="Red"] "readLine function failed"[/COLOR] ? [CODE=JAVA] try { input = Integer.parseInt(br.readLine());// Integer.parseInt method here which calls the readline() method off … | |
Re: what exactly do you mean by 'a variable' speeds? | |
Re: if you're just starting with Java, it might be a good idea to leave IDE's such as NetBeans out of it for a while. true, they come in handy, and you get the job done, you just don't really know how it works, and in the end, that's the important … | |
Re: you could use a combination of: JMenuBar, JMenu and JMenuItem as an alternative for the function of your JButtons. This way you won't have to "invent" unneccessary functions for your application | |
Re: [QUOTE=kendaop;1103165]Line 20 of LinkedList should read: [CODE]Node newNode = new Node(data, asciiValue);[/CODE] I apologize for the error.[/QUOTE] you may start with correcting this as well: [CODE] if(temp.getAsciiValue == -1) { temp.setData(data); temp.setAsciiValue = asciiValue; temp.setNext(tail); tail.setPrev(temp); }[/CODE] to [CODE] if ( temp.getAsciiValue() == -1) { temp.setData(data); temp.setAsciiValue(asciiValue); temp.setNext(tail); tail.setPrev(temp); } … | |
Re: [QUOTE=oxxxis;1106276]Hi, I am new to java programming, but i have this problem: I open an image, i put ir in array 2 dimensional, teh idea is like this array[count][0]=x; array[count][1]=y array[count][2]=red; array[count][3]=green; array[count][4]=blue; array[count][5]=alpha; I do so becaude i need to work with colors, but later on i want to … | |
Re: you'll need to place the package p1 somewhere the compiler of the second application can find it. also, you might want to put a print-instruction in the balance constructor or at the end of the main method, just to check whether or not the program does what you intend it … |
The End.