7,116 Posted Topics

Member Avatar for laguardian

From the look of it that printSelf method belongs in the Person class, not the Driver, and it should be an instance method, not static. That's because it's obviously intended to print the details of a current Preson instance.

Member Avatar for stultuske
0
132
Member Avatar for hwoarang69

Any reason you have to be on obsolete Java 1.6? The final security update to 1.6 (the one you have) was over a year ago, and you are now missing literally hundreds of fixes, including many "critical" fixes. For your own protection, and the protection of others sharing your network, …

Member Avatar for hwoarang69
0
672
Member Avatar for Mr.M

Java has no direct support for the Windows registry, but it's easy enough to use `ProcessBuilder` to execute the Windows `reg.exe` command-line utility to perform registry queries or updates.

Member Avatar for Mr.M
0
2K
Member Avatar for brittney_2

Normally the `throws` and the `try/catch` are in different methods as in void method1() throws Exception { ... if (...) // there's a problem that I can't fix... throw new Exception ("Sorry, it's gone wrong"); } ... } void method2() { ... try { method1(); catch(Exception e) { // I …

Member Avatar for brittney_2
0
223
Member Avatar for anita_2

In Java we would probably use classes rather than 2D arrays here - eg a Ticket class and a Player class. Then you just need simple references or lists (1D arrays).

Member Avatar for anita_2
0
187
Member Avatar for Pavithra_1

A problem with the first code is that `result` and `to` are declared inside the try block, so those variables cease to exist as soon as the block is exited. You need to declare them outside the try block if you want to use them outside the try block.

Member Avatar for jwenting
0
154
Member Avatar for shrutisoni

Never do this when writing new code: } catch (Exception e) { } If/when there is an error you just told Java that you didn't want to know anything about it, and please discard the detailed error message that Java just created for you. ALWAYS put an e.printStackTrace(); in your …

Member Avatar for pyaythu
0
113
Member Avatar for Usman_7

Hi Usman. We get a lot of posts here from people wanting us to do their homework for them, which typically get replies like the above. My guess is tha this is a genuine question, and not just a homework assignment... can you confirm please?

Member Avatar for Usman_7
0
278
Member Avatar for SpottyBlue
Member Avatar for anita_2

It seems there's a problem with the rules of the game: "only one person can win full housie" and "there may be numbers of winner". That is not a Java programming problem. Only you can decide how to change those rules so they are consistent. Then writing the Java will …

Member Avatar for jwenting
0
197
Member Avatar for Szabi Zsoldos

That screenshot isn't a stacktrace, and doesn't help. You don't provide the source for your StringUtils class (t's not part of the standard Java API). That leaves us with more questons than answers. You say "everything stops, empty." Do oyu mean the program terminates without any errors? What exactly is …

Member Avatar for Lucaci Andrew
0
275
Member Avatar for kannathasan.12

It's saying you have not defined anything called Mailercm Probably you are missing that class's definition, or you are mis-spelling its name.

Member Avatar for JamesCherrill
0
45
Member Avatar for Slavi

Ahhh - the old BigInteger trick. What you have found is an over-complicated version. The simplest form is just one short line... You can use the simpler version of getBytes without any arguments - that just uses the default char set. If you stick to ASCII characters you'll be OK. …

Member Avatar for JamesCherrill
0
387
Member Avatar for Mrewan79

Please be much more specific about your question. We don't know whether you are struggling with how to start a Java program or struggling with some obscure side-effect of using JLayeredPanes in a multi-threaded environment, or any point inbetween. Are you looking at Swing or JavaFX? How much do you …

Member Avatar for jwenting
0
470
Member Avatar for phuttawat

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 jwenting
0
347
Member Avatar for rowen_1

What exactly do you want to happen in the user interface (as seen from the user's viewpoint). Eg in round 1 if the dealer makes a bet exactly what do you hope to see happening on the screen?

Member Avatar for rowen_1
0
302
Member Avatar for Adami

The pattern here is a recursive method with a number of obscure parameters that are involved in controlling and tracking the recursion. In order to make it easier to use, there's a simpler public version without all the extra parameters, that simply calls the recursive method with a suitable set …

Member Avatar for Adami
0
3K
Member Avatar for asaidi

Can I confirm what you are asking? You have some Cabinets, each with a number and a title. You want to display the title in the GUI, but get the number when the user has made his selection. Is that right? Are all the titles unique?

Member Avatar for mKorbel
0
303
Member Avatar for tabish saroha

Hi Please do not hijack other peoples' old threads. Start a new thread for your question, and give as much information as you can.

Member Avatar for JamesCherrill
0
1K
Member Avatar for CreeperFace22

ImageIO is a class that is provided as part of the standard JavaSE installation. You just need to import it, as in inport javax.imageio.ImageIO;

Member Avatar for stultuske
0
295
Member Avatar for nicemedo1

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 stultuske
-2
1K
Member Avatar for rowen_1

For x = 1,2,3 you display 4,6,8 elements. No need for those if tests. You can do that in a single loop if you use a simple formula to covert 1,2,3 into 4,6,8,,, eg multiply by 2 and add 2.

Member Avatar for JamesCherrill
0
274
Member Avatar for toring

Yes, many people here have done projects in that area. Hoever, 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 …

Member Avatar for jwenting
-1
442
Member Avatar for moaz.amin.37

The Java Language Specification does not have "virtual methods" or "virtual functions" These are jargon from another language. If you have a question about C++ this is the wrong forum.

Member Avatar for jwenting
0
302
Member Avatar for kimmgillie

As you can see from the above posts, there's little tolerance here for people who just want someone to their homework. If you want to continue then please explain what you have done so far, why/where you are stuck, and exactly what help you need to make more progress. Then …

Member Avatar for Hiroshe
0
198
Member Avatar for rowen_1

chars in Java are numeric types - they are 16 bit integers that are used to represent characters in unicode. So its pefectly OK to compare them with > or < operators. Unicode 'a' - 'z' are represented by the numeric values 97-122 respectively, so the comparisons follow normal alphabetic …

Member Avatar for rowen_1
0
166
Member Avatar for coroll

> rss.getString(1) > Second column of my table is a type of varchar(10) For some perverse reason the ResultSet get methods use indexes that are 1-based, not 0-based, so getString(1) retrieves from the first column not the second. > String s=resultSet.GetString(1) > System.out.println(resultSet.GetString(1)) The difference here is that println does …

Member Avatar for jwenting
0
606
Member Avatar for Violet_82

There's a good trick to use here, which is to create a handler that knows which button was pressed - it looks like this: class MyListener implements ActionListener { int buttonNumber; public MyListener(int b) { // constructor takes button number buttonNumber = b; } public void ActionPerformed(.... System.out.println("Handling event for …

Member Avatar for Violet_82
0
2K
Member Avatar for SpottyBlue

> I've encounted some problems after I run the program You've been around here long enough to know that's useless as problem description! EXACTLY what "problems"? Don't expect us to guess!

Member Avatar for JamesCherrill
0
300
Member Avatar for Mr.M
Member Avatar for stephen.teacher
Member Avatar for jhender4880

Just 3 cities - you can search all possible paths. TSP is only interesting when you get many cities.

Member Avatar for jhender4880
0
255
Member Avatar for Toby_1

literal numbers like that default to int. For bigger numbers append an "L" to indicate that you want a long value.

Member Avatar for JamesCherrill
0
107
Member Avatar for Slavi

After your `serverSocket.accept();` you need to start a new thread to handle that connection (pass the Socket object to the construtor of your new thread). Then in that new thread open the input & output streams etc. You main thread then loops back to the `accept` and waits for user2 …

Member Avatar for Slavi
0
422
Member Avatar for stephen.teacher

I can't see any problems in that code. Are you *certain* that the nodes are being populated correctly with the names and links?

Member Avatar for stephen.teacher
0
222
Member Avatar for imclumsy

A bizarre answer... 1. This thread has been dead for 3 years, it's a bit late to answer ir. 2. That method doesn't return anything. In fact it has no output of any sort at all. It's completely useless.

Member Avatar for JamesCherrill
0
271
Member Avatar for Slavi

Client-server automatically needs multiple threads. No matter how you do it at the very least you will be waiting for the local user to do something and simultaneouly waiting for the other user to do something. If you want to extract maximum learning from this I'd set it up as …

Member Avatar for Slavi
0
251
Member Avatar for anita_2

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
162
Member Avatar for shadowsrose1
Member Avatar for moaz.amin.37
Member Avatar for jwenting
0
439
Member Avatar for dansmith1234

Do not ask for help to pursue any illegal activity including, but not limited to, hacking and spamming Thread closed.

Member Avatar for JamesCherrill
-3
254
Member Avatar for Slavi

The error shows your classes and manifest are ok. It looks like you failed to package your png files in the jar properly - the message implies it can't find them.

Member Avatar for Slavi
0
520
Member Avatar for dlunge
Member Avatar for Slavi

Static methods execute without an assocated instance of the class, so they don't have any direct access to any instance variables or instance methods. They only have direct access to static variables and static methods. It's nothing to do with get/set as such.

Member Avatar for JamesCherrill
0
227
Member Avatar for iamcreasy

^ ... provided they are declared as being in the same package. If you use (multiple) packages then you need a directory hierarchy that matches the package hierarchy. ps: It really has to work that way, just consider two classes each of which references the other.

Member Avatar for iamcreasy
0
226
Member Avatar for Slavi

Separating words and hints is a forumla for update chaos. Just read the file 1 line at a time. Get the index of the first " " and use that to substring the word and the rest of the line (the hint). Store them in 2 ArrayLists (or create a …

Member Avatar for Slavi
0
258
Member Avatar for silvercats

rmic? That has been obsolete for ten years (well, over nine and a half anyway). It was made unneccessary in Java 1.5 (Sept 2004). See http://docs.oracle.com/javase/tutorial/rmi/overview.html Don't waste any more time trying to fix an rmic error - update to the current simpler approach as detailed in that tutorial.

Member Avatar for jwenting
0
2K
Member Avatar for Builder_1
Member Avatar for JamesCherrill
0
302
Member Avatar for laguardian

The quickest thing to do would have been to print strName just before the if test, which would have revealed the problem without waiting for a DaniWeb response. But anyway... That code fragment seems a bit scrambled, but it looks like you have a scanner problem. I hate Scanner. A …

Member Avatar for JamesCherrill
0
230
Member Avatar for laguardian

System.out.print(" " +num+ "is in index " + array[i]); You are printing the *value* in array[i], not the *index*.

Member Avatar for laguardian
1
242

The End.