4,084 Posted Topics

Member Avatar for justin.dienger

a few other remarks, about how you "detect" which button has been clicked: `if (buttonclicked.getText().compareTo("START") == 0)` a better way would be: `if ( "START".equals(buttonClicked.getText())` it's shorter and it follows the naming conventions a bit more. but, and here's the big 'but' comming up: what will you do if there …

Member Avatar for stultuske
0
2K
Member Avatar for G_S

the class itself is not a member of that other class, but an instance of it is. not entirely sure what your question is, or what your teacher said, but sure, if you create a class MyClassA, you can have another class with a MyClassA as either instance or static …

Member Avatar for G_S
0
196
Member Avatar for shoaib672002
Member Avatar for chdboy

also, get your terminology straight: Java doesn't have functions, it has methods. if I'm not mistaken, Connection is not a class, it's an interface. (I assume your ConnectionDB implements Connection?) `private static Connection myConnection = new ConnectionDB();`

Member Avatar for chdboy
0
207
Member Avatar for bhallarahul

read the input process the input to output look at the output. if you need to work with xml using Java, [JDom](http://www.jdom.org/) is a stable and very well documented library that can help you there.

Member Avatar for stultuske
0
181
Member Avatar for yyzdslr

well, cross-posting is not really appreciated. basically, you don't show us any code, and the description you give (on the other forum) shows that even though your syntax is right, you've added the wrong fields the wrong number of times. the best thing to do is to think over the …

Member Avatar for JamesCherrill
0
313
Member Avatar for game06
Member Avatar for dlgmu537

either you say: protected double avg = avg = st_marks/2; or you should set the value inside a constructor or method.

Member Avatar for jalpesh_007
0
195
Member Avatar for Kosamov

if you had checked the code, you'ld probably have seen that the chances of it compiling, let alone running, are pretty small. for instance: `while(city != *)` with city being a String, should probably be `while ( !city.equals("*"))` also, the indentation isn't very clear. I can see where that loop …

Member Avatar for abhi_d_one
0
176
Member Avatar for milkman93

> This works, but the user does have the ability to add a greater number of courses than 6. So this way any buttons great than index 5 would be useless. I have .... no idea what you're trying to say there. (one of) the advantages of Lists and Collections …

Member Avatar for mKorbel
0
487
Member Avatar for nitin1

imBaCodes: so, if some cheap-ass industrial dumps a lot of toxic waste in a healthy environment, damns the next x generations to a certain, painfull and very fast death, then > Its because god decided some of us to have it. seriously, I hope you are kidding. it's a bit …

Member Avatar for TonyG_cyprus
0
441
Member Avatar for mical700

the class name in your code is 'CheckigAccount' (without n) that might be your problem.

Member Avatar for mical700
0
4K
Member Avatar for NardCake

hmmm ... I was thinking of buying myself a new desktop (bit more power under the hood, easier to upgrade, ... ) but with all the mess that Windows 8 basically promisses .... don't really have the time to go shopping for all different parts and assemble it myself, was …

Member Avatar for jwenting
0
466
Member Avatar for ef_mag

`static void main (String[] args) throws Exception` have you tried by declaring your main method public? also, it's bad design to allow your main method to throw Exceptions: you won't be able to prevent your application from crashing if something were to go wrong.

Member Avatar for JamesCherrill
0
2K
Member Avatar for zai04

you mean if you enter First Middle Name, that you get a label with FMN? sure, why wouldn't that be possible?

Member Avatar for stultuske
0
206
Member Avatar for riahc3

just ignore the NetBeans wysiwyg "tutorial", the rest should be able to help you out. [Java Swing tutorial](http://docs.oracle.com/javase/tutorial/uiswing/)

Member Avatar for cisumma
0
387
Member Avatar for letlet_pogs

you don't really "leave" your main method.. so, instead of focusing how to get back in it, focus on how not to get out of it :) as JavaAddict already mentioned, your program will run the code in your main method, and if that is all finished, your program will …

Member Avatar for JamesCherrill
0
7K
Member Avatar for fonzali

depends, whether those that hold the copyright allow it or not. but what if the code was posted there before it was posted on DaniWeb? :)

Member Avatar for fonzali
0
188
Member Avatar for unikorndesigns

for webapps, GWT is not too hard neither, or for desktop applications, you can learn a lot by getting to know Swing. but if you are, like you say, just looking into Java without having any experience or knowledge about it, getting to know the language first might be a …

Member Avatar for stultuske
0
203
Member Avatar for odose

there are quite a few tutorials around about working with Timers. have you taken a look at those?

Member Avatar for stultuske
0
65
Member Avatar for overwraith

another good reason is to keep the main part of a class's functionality, but to alter the functionality of, let's say: one method. but extending JOptionPane makes no sense, since about all it's methods are static.

Member Avatar for overwraith
0
2K
Member Avatar for funkey100

"I know a bit of Java", and with that you assumed you know enough to write a platform based 2D game? I wish you all the luck. what have you got so far?

Member Avatar for funkey100
0
300
Member Avatar for riahc3
Member Avatar for game06

either you instantiate it in your main method, or you call the instance from your level class). but why are you passing a reference of which you are sure it'll always be null to a method? that's pointless. MainClass.java: `EnemyBoss enemy;` Level.java: `EnemyBoss enemy = new EnemyBoss(5, 10);` just because …

Member Avatar for JamesCherrill
0
136
Member Avatar for softswing
Member Avatar for stultuske
0
96
Member Avatar for thewayoftheduck

[official classes tutorial](http://docs.oracle.com/javase/tutorial/java/javaOO/classes.html)

Member Avatar for stultuske
0
266
Member Avatar for Nandomo
Member Avatar for Pobunjenik

it's pretty easy to play sound files. .wav files are supported by core Java, no additional libraries required. if you want to play .mp3 files, on the other hand, you'll have to look for some additional resources: [jmf](http://www.oracle.com/technetwork/java/javase/download-137625.html) (even though a bit outdated) can help you, but in my personal …

Member Avatar for Pobunjenik
0
959
Member Avatar for toldav

also, in one of your first posts in this thread, you had something like: final int dollars = 0; ... dollars = dollars; this is quite ... weird. first of all, the final keyword won't allow you to change the value of the variable once the value has been set. …

Member Avatar for somjit{}
0
264
Member Avatar for l.worboyz

do understand this is a Java forum, not a JavaScript forum. the JavaScript forum can be found [here](http://www.daniweb.com/web-development/javascript-dhtml-ajax/117)

Member Avatar for stultuske
0
293
Member Avatar for Violet_82

also, quite important: you should adopt good coding habbits as soon as possible: make your instance variables private and use mutators (setters and getters) to get to them from outside the class. this 'll help with encapsulation.

Member Avatar for Violet_82
0
159
Member Avatar for jalpesh_007

no problem with that code at all. do you get an error message? have you checked the value of the path you are trying to pass?

Member Avatar for stultuske
0
169
Member Avatar for toldav
Member Avatar for jspence29
Member Avatar for game06

that depends. first of all, do you know what the 'this' keyword refers to?

Member Avatar for stultuske
0
128
Member Avatar for IIM

contradictory to the rules IMHO. it's a bit annoying to repeat information,or to post jibberish, but if this would go through, someone might have to do that, just to give an opinion.

Member Avatar for deceptikon
0
275
Member Avatar for mical700

> Everything in java is object even the primitive datatypes can also be converted into object by using the wrapper class. let's agree to disagree. here you are contradicting yourself (in my defense ;) ) first, you say that everything in Java is an Object, then you say there are …

Member Avatar for stultuske
0
492
Member Avatar for abhi_marichi

anupgupta: this is not a decent reason to revive a dead thread. it hasn't been replied in for three years, that should tell you enough. also: the information you need is posted above, read, click, use. we're not going to deliver you custom made code if that's what you're hoping …

Member Avatar for stultuske
0
230
Member Avatar for Tinnin

in the end, nobody can know everything about any language. get used to it. no matter how long you'll be working, you'll always need to choose between stuff to learn, and what not to.

Member Avatar for TonyG_cyprus
0
223
Member Avatar for sk8ergirl
Member Avatar for Mike Askew
Member Avatar for tanya1989

didn't downvote, just replying on the post above that: you also need to remember that if you use the name val in the declaration of the array, you should also use the name val (not values) when trying to print it's contents.

Member Avatar for stultuske
0
335
Member Avatar for jelly46

so ... what makes you think you need to change anything about the Javascript code? the css.... maybe. but otherwise, nop.

Member Avatar for stultuske
0
57
Member Avatar for game06

by instantiating that class two times. Bullet bullet1 = new Bullet(Color.RED); Bullet bullet2 = new Bullet(Color.GREEN); but I do hope you understand why this part of your code makes no sense at all: public void Bullet extends Item { int dx = 1; }

Member Avatar for JamesCherrill
0
130
Member Avatar for daksh1998

you can run each (desktop) or command line java application, by running the next command prompt command on the class file: javac yourClass (if yourClass is the class that contains your main method, of course :) ) normally, a .jar file should work and get you able to run your …

Member Avatar for stultuske
0
3K
Member Avatar for missy maretele

that's a nice assignment. now ... do you actually have a question to go with that? if no.. read the community rules. you are welcome here to study Java by improving your skills, not by asking us to do your homework for you. please take a look at the [Community …

Member Avatar for stultuske
-1
860
Member Avatar for chdboy

yeah well, that ain't what you need. check [this](http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774)

Member Avatar for chdboy
0
909
Member Avatar for game06

objects, instances, ... yup. for instance: Person me = new Person("Stultuske"); Person you = new Person("game06"); In the above lines of code, there's only one class: the Person class. there are, on the other hand, two instances of it: me and you.

Member Avatar for game06
0
143
Member Avatar for Samerases

> I wish you to help me in solving this homework you could at least be honest and replace that line by > I wish you would do my homework for me

Member Avatar for B0716L
-2
137
Member Avatar for StefanRafa0

don't really understand what you're trying to do here. especially since you can't translate words letter by letter. for instance: > fire > brand (the dutch word for fire) > feuer (the german word for fire) > incendie (the french word for fire) this should show you two reasons why …

Member Avatar for StefanRafa0
0
177

The End.