7,116 Posted Topics

Member Avatar for mical700

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you. DaniWeb Member Rules (which you agreed to when you signed up) …

Member Avatar for JamesCherrill
0
123
Member Avatar for sirlink99
Member Avatar for Fedhell

That's not a complete prograqm, it's just the interesting bits, so you can't run it. ps Many of our members have English as their second (or third...) language, so abbreviated language will be unreasonably difficult for them. Please keep to proper English. DaniWeb Member Rules include: "Do post in full-sentence …

Member Avatar for JamesCherrill
1
508
Member Avatar for zdneth

setMnemonicAt(int tabIndex, int mnemonic) http://www.kodejava.org/examples/733.html

Member Avatar for JamesCherrill
0
108
Member Avatar for zacant

The Java compiler is your friend. Don't be afraid to try and compile your code. There's no point trying to get it right before compiling. Just chuck it into the compiler and see what errors it throws up. That costs you nothing. At first you;ll get a lot of errors, …

Member Avatar for JamesCherrill
0
613
Member Avatar for hwoarang69

It looks like maybe you start a new timer when you restart, but the old timer is still running, so now your actionPerformed gets called twice every 10 mSec, and every time you restart that gets worse. Make sure that when you restart either you just keep using the old …

Member Avatar for hwoarang69
0
558
Member Avatar for hwoarang69

I don't agree with sleep here. The "application" can't sleep, only a thread can sleep. After the start() method everything in this code runs on the Swing EDT, and sleeping that thread will kill the animation (and any other swing activity). Three solutions: 1. When you set the text, set …

Member Avatar for hwoarang69
0
304
Member Avatar for tudor.laze

Unless you are runnning a very old verison of Java you can convert an Integer to a Double trivially using auto boxing/unboxing: Integer i = 3; Double d = new Double(i); Your array index exception is at line 42 of Poly.IntegerPolynomial.getCoeff, where you are trying to access element number 3 …

Member Avatar for JamesCherrill
0
5K
Member Avatar for bobit

If this simple exercise is causing problems its probably because the idiot who designed it doesn't understand inheritance. Inheritance is a *is-a-kind-of* relationship, and a cylinder is NOT a kind of circle. What happens if I add some perfectly sensible methods to Circle like `boolean containsPoint(int x, int y)` ? …

Member Avatar for stultuske
0
575
Member Avatar for HankReardon

> Should you check for equality before swapping? The detailed argument depends on whether the array is of a primitive type or contains objects. For two primitives an equals test will be trivial, and a swap pretty trivial too. For objects you will use a Comparator to determine the sort …

Member Avatar for JamesCherrill
0
4K
Member Avatar for gronkite

I would try all the same, already sorted, and already sorted but in the opposite order (which will be the worst case for some algorithms)

Member Avatar for somjit{}
0
802
Member Avatar for bobit
Member Avatar for JamesCherrill
0
2K
Member Avatar for timetraveller1992

I not sure that your resizing method will correctly get the size in the final result. Use *getScaledInstance* to resize an Image safely.

Member Avatar for JamesCherrill
0
156
Member Avatar for harinath_2007

Whenever I need to reduce stress I find a post that was obviously intended as a joke and take it very very seriously </humour>

Member Avatar for ~s.o.s~
-1
268
Member Avatar for SYvonneMendoza

I've never seens anyone add GUI components inside a paint method before. It wouldn't surprise me if that didn't get painted, at least not until there was some otehr event that caused another repaint. Anyway, it's a terrible idea. Paint gets called for all kinds of reasons, at any time, …

Member Avatar for SYvonneMendoza
0
241
Member Avatar for EliteNMC

EliteNMC: What exactly do you mean by "spam-bot" - is that something that finds and deletes spam, or something that sends spam?

Member Avatar for JamesCherrill
-1
101
Member Avatar for joseph.lyons.754

You probably have to eliminate the duplicates from the data you are inserting into the combo box. One way to eliminate dups is to add all your data to a Set (eg TreeSet,use the addAll method) because Sets don't contain duplicates. Then you can simply convert the Set to an …

Member Avatar for joseph.lyons.754
0
218
Member Avatar for pilik

Java is trying to print your Pair instances, which it does by calling their toString() method. All classes inherit one from Object, which just returns the name of the class and it's hash code, eg Example$Pair@1fc4bec To print something more useful, override the ` public String toString() ` method to …

Member Avatar for pilik
0
1K
Member Avatar for WDrago

I vote for the second version. The extra lines and indentation in version 1 create a lot of clutter and will push the following code off the screen - just imagine it inside a loop inside a method definition...

Member Avatar for WDrago
0
189
Member Avatar for l.worboyz

Are those methods defined in the AbacusModel class? In that case you created an instance of that class on line 23 as part of your constructor, so you can use myAbacus to call those methods. Without seeing the method definitions it's impossible to comment on what parameter(s) to pass. I …

Member Avatar for JamesCherrill
1
386
Member Avatar for thetechie
Member Avatar for l.worboyz
Member Avatar for l.worboyz
0
267
Member Avatar for jalpesh_007

There's more to this than it seems. Here's a simple *single* source file public class MulipleMains { public static void main(String[] args) { System.out.println("One"); } } class MulipleMains2 { // can't be public public static void main(String[] args) { System.out.println("Two"); } } Eclipse will let me run that single file …

Member Avatar for JamesCherrill
0
148
Member Avatar for Nagarajan M

Is this an attempt to bump [this thread](http://www.daniweb.com/software-development/java/threads/449778/how-to-bundle-jre-inside-jar-to-run-jar-in-non-java-system) ?

Member Avatar for stultuske
0
3K
Member Avatar for adikimicky

When you say "not opening", exactly what does or doesn't happen? Do you see any error messages or other output? What happens if you open a command window and run the jar with java,exe?

Member Avatar for ghincelino
0
254
Member Avatar for thunderjuice

Now my question is, how would I go about making an array that will hold the attributes of the class circle in the geometry class? Answer: you don't. The individual Circle objects hold their own attributes, all you need is an array of Circle objects

Member Avatar for thunderjuice
0
267
Member Avatar for XerX

Why are you overriding those methods? What's wrong with just inheriting them? Your overides look just like the originals anyway.

Member Avatar for JamesCherrill
0
244
Member Avatar for officallysabbir

To call an instance method of the CustomerModel class you need an instance of that class. Your CustomerController creates such an instance on line 25 (cMod), so you can use that to call the method(s), as in cMod.search(etc...

Member Avatar for JamesCherrill
0
479
Member Avatar for Murphyv10

One small suggestion: To help you read that data back in again you may want to write the number of columns and number of rows at the beginning of the file. Otherwize you won't know how many column names to read before starting to read tha data, or how to …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Nagarajan M

This seems like a bad idea, even if it's possible. How will you handle essential security updates to the JRE?

Member Avatar for Nagarajan M
0
3K
Member Avatar for jalpesh_007

The server seems to be waiting for input from its local user before it tries to read iput from the remote client. That seems wrong. Line 23 may be the problem. ps Next time please describe your problem properly - eg what results you expect vs what you got. Saying …

Member Avatar for JamesCherrill
0
171
Member Avatar for harinath_2007

There may be some advantage in using java.util.Timer rather than sleep (fewer threads hanging around, easier to clean up resources between events). All you can do about memory handling is to ensure you don't keep any references to objects you no longer need. Try running a profiler to see if …

Member Avatar for mKorbel
0
169
Member Avatar for somjit{}

Unless you are processing a vast number of dequeues against a huge queue then "faster" is not going to be relevant. Do you reeally care if they take 1 microSecond vs 2 microSeconds? Easy to code, easy to read and understand, easy to debug, easy to modify or enhance - …

Member Avatar for somjit{}
0
2K
Member Avatar for M4trixSh4d0w

If you are sending screen captures for a remote monitoring kind of app then you may find [this](http://www.daniweb.com/software-development/java/threads/254810/find-the-differences-between-two-images-and-the-locations-of-the-differences/) thread interesting. A few of us tried all kinds of ideas, and found the best performance by keeping a connection open, and sending only the differences between each screen and te previous …

Member Avatar for JamesCherrill
0
2K
Member Avatar for JamesCherrill

Here's a simple thing that I can't find a simple solution for - so any suggestions will be very welcome... I have a `Map<String, MyClass>` and if it has more than 1 entry I let the user pick a MyClass instance by displaying the keys. No problem there. If it …

Member Avatar for JamesCherrill
2
344
Member Avatar for StefanRafa0

Disclaimer: I haven't used these classes, I'm the opposite of an expert on them, but since nobody else has chipped in and Stefan is getting desparate... When you start the first Clip playing you use a local variable for the Clip, so when the method terminates you no longer have …

Member Avatar for JamesCherrill
0
416
Member Avatar for azil87glenda

DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules Post what you have done so far and someone will help you from there.

Member Avatar for valdez25
0
221
Member Avatar for l.worboyz

If your method declares a return type (boolean, int etc) then every possible execution of the method MUST return a suitable value. You have if/else tests that, if they are true, do not return a value. You must add return statements so that every possible path through yopur methods returns …

Member Avatar for valdez25
0
308
Member Avatar for cmps

Don't confuse variables and objects. std in the create method is a variable, specifically a reference variable. It's scope is the body of the create method, and it will cease to exist immediately when the method finishes executing. Line 13 does not create a new variable, it just changes the …

Member Avatar for cmps
0
235
Member Avatar for isacc

yes. Just call the appropriate method for the toggle button in your action performed method for the stop button

Member Avatar for mKorbel
0
175
Member Avatar for JavaGr33nh0rn

DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules Post what you have done so far and someone will help you from there.

Member Avatar for JavaGr33nh0rn
0
192
Member Avatar for JavaGr33nh0rn
Member Avatar for JavaGr33nh0rn
0
337
Member Avatar for xHellghostx

It's hard to understand that description. Maybe if you posted your actual code so far that would be clearer? Does B extend A?

Member Avatar for stultuske
0
283
Member Avatar for Unused Mass

You can loop through all the keys, or loop through all the values. HashMap has methods that give you all the keys or all the values so you can loop through them. Inh this case you could loop through all the keys, checking the values that each key refers to, …

Member Avatar for tux4life
0
155
Member Avatar for joseph.lyons.754

setSelectedItem or Index should work - if they didn't then the problem is probably elsewhere. Without seeing your code it's impossible to tell.

Member Avatar for JamesCherrill
0
235
Member Avatar for slygoth

It looks like `obj.getProductId()` should not be inside the quotes - it's not part of a string literal, it's an expression you want evaluated.

Member Avatar for bguild
0
156
Member Avatar for DEBASCOGUY

Debascoguy: DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules

Member Avatar for JamesCherrill
0
272
Member Avatar for uknown2

> As for 5th question > This program is to reverse the array elements Are you quite sure it doesn't just rotate the elements right by 1 position? [ edit: original post now updated as per IIM's comment]

Member Avatar for JamesCherrill
0
176
Member Avatar for DevilDog22

Java is parsing the last semicolon on line 18 as the statement that the for loop has to execute. Since it doen't contain any code (just a ;) that's what is called an empty statement. It also means the block that starts with the { on line18 is not part …

Member Avatar for stultuske
0
810
Member Avatar for anisha.silva

Maybe the variable customerService is null at that point - if you posted the exact complete exception messgage then it would probably be clearer, or try printing customerService there to confirm.

Member Avatar for anisha.silva
0
365

The End.