7,116 Posted Topics

Member Avatar for bhallarahul

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. ps: This is not a hard …

Member Avatar for JamesCherrill
0
178
Member Avatar for ceelos1974

Hello mbongiseni, welcome to Daniweb. Please don't join your question onto the end of someone else's thread. Please start your own new thread for your question. Before posting you may also want to have a look a the Java tutorials on the Oracle web site, eg http://docs.oracle.com/javase/tutorial/getStarted/cupojava/win32.html

Member Avatar for ceelos1974
0
228
Member Avatar for Keaselstein

The method MinDistanceNode() is defined in the Node class, so to call it you need a single instance of Node, not a whole ArrayList of Nodes

Member Avatar for jalpesh_007
0
7K
Member Avatar for Ralphael
Member Avatar for JamesCherrill

I'm suffering from a complete brainfreeze here; maybe some NetBeans user can un-block me without making me look like a complete idiot? Thanks. I usually use Eclipse, but for this particular project it has to be NetBeans. I have two projects defined. One is the main project with packages - …

Member Avatar for JamesCherrill
0
280
Member Avatar for sushants
Member Avatar for JamesCherrill
0
111
Member Avatar for sushants

It has no pointers. Pointer errors and related memory managment problems are a major source of security problems in C and C++

Member Avatar for sushants
-2
162
Member Avatar for loozax

Hello gauravbit70, welcome to DaniWeb. Don't be put off by Stultuske, he's just having a bit of fun. Your contributions are very welcome here. Before posting please do check the dates on threads, and please don't just post solutions with no explanations or comments - we want people to be …

Member Avatar for JamesCherrill
0
715
Member Avatar for 9tontruck

Did you notice that this is the Java forum? Do you know that your program is not a Java program?

Member Avatar for peter_budo
0
153
Member Avatar for ktsangop

You could push your messages onto a LinkedBlockingQueue from one thread, and loop processing them in another (take from the queue blocks if the queue is empty) http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/LinkedBlockingQueue.html (but I agree with jwenting) ps: Looking at the 8 ways in your link, it's number 4 ("Observable") that The Java GUI …

Member Avatar for ktsangop
0
376
Member Avatar for Nubitol

You can create a Shape with those line segments, and use an AffineTransform in Graphics2D to rotate/shear/ etc But 8 hours from now? Wow, that's going to be tough. Your teacher must be really challenging you to give you such short notice. (I assume, of course, that you haven't known …

Member Avatar for JamesCherrill
0
334
Member Avatar for aravind326

You haven't posted all the relevant code, but using String and getBytes(Charset...) is the wrong way to go when you need to read and write raw bytes from/to a stream. Using any kind of String or Charset will result in bytes being interpreted and replaced according to their character equivalences …

Member Avatar for JamesCherrill
0
216
Member Avatar for kay19

Obviously you haven't compiled this code, let alone tested it. Before you ask people to spend time looking at it, take the time to compile it and fix all the compiler errors that you can. If you can fix them all (which yu should be able to do) the write …

Member Avatar for kay19
0
301
Member Avatar for Lonerli
Member Avatar for cool_zephyr

Java byte variables are signed, so they are in the range -128 to +127, hence -56 rather than +200

Member Avatar for JamesCherrill
0
401
Member Avatar for Adi92
Member Avatar for rhaylee

Nobody has the time to read all that and try to understand what it is you need. Please ask *specific* questions, backup up by details of what you have already done youself to try to answer them.

Member Avatar for JamesCherrill
0
1K
Member Avatar for rhaylee

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 doing your homework for you. DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence …

Member Avatar for JamesCherrill
0
438
Member Avatar for cvanithakpm

You haven't given much background to help anyone pick the rigt answer, but, in general, if the columns are of various types, then you would be pretty safe with creating a class to represent one row (instance variables for each column) then having an ArrayList of those instances to represent …

Member Avatar for jwenting
0
192
Member Avatar for sherjaan
Member Avatar for JamesCherrill
0
821
Member Avatar for fmasroor

You need a JDK (Java Development Kit) from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html The installer will put it in a default location, which is normally best. Eclipse should find it when you re-start Eclipse after installing the JDK. If yo have no previous experience of Java I strongly recommend that you do not start …

Member Avatar for JamesCherrill
0
243
Member Avatar for Violet_82

Start with one simple validation, get it working, then repeat that pattern. Here's a typical pattern for inputting one value and validating it, with an initial prompt, and a different re-prompt after errors: display normal request for input while (true) { get user input if (user cancelled) exit program // …

Member Avatar for Violet_82
0
326
Member Avatar for sparob

You have repeated code for number1 - number5 where you really only need one number - the loop will allow you to enter mutiple values... print "Input grades scores, -1 to exit" do input a number if (number >= 90) etc etc while (number >= 0) // exit if number …

Member Avatar for sparob
0
196
Member Avatar for bdl365_1

Check the JOptionPane documentation. There's a method that allows you to give a prompt (eg "Enter file name") and get the answer back in a String

Member Avatar for bdl365_1
0
416
Member Avatar for Varunkrishna

Almost. The syntax allows for a list of expressions in each part of the for, so `for(i=0,ii=result.length;i<ii;i++)` is OK. See Java Language Spec section 14.14 It's probably written that way to avoid re-evaluating result.length on each pass of the loop in a (mistaken?) attempt to optimise execution speed. But your …

Member Avatar for JamesCherrill
0
224
Member Avatar for Lindita01
Re: HELP

I don't know what language that is, but it's not Java. You're in the wrong forum my friend.

Member Avatar for peter_budo
0
153
Member Avatar for nishad_forums

Sounds like you expect A to connect directly to B? That implies that B has a server running an open server port that's accessible from the internet. Normally an app like this uses the server to route messages from one user to another, so no user needs to know anything …

Member Avatar for nishad_forums
0
940
Member Avatar for siblers

It's a good idea to use an @Override annotation whenever overriding an inherited method or implementing an abstract one, eg @Override public void setRent (boolean rented){ this.rented = rented; } This will immediatly generate a compiler error telling you exactly what you did wrong (and will be helpful for anyone …

Member Avatar for JamesCherrill
0
183
Member Avatar for harshInITworld

Hello bakawas, welcome to DaniWeb Normally we discourage people from posting to threads that have been dead for a year, but in this case you have posted an answer to the question that will be useful to anyone searching that topic, so thank you very much for your contribution. (ps …

Member Avatar for JamesCherrill
0
4K
Member Avatar for henrydmainguy

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 JamesCherrill
0
105
Member Avatar for parkz16

Why are you talking about editing the "fixed Java classes"? The error is in your code. The error messages relate to a single error and show the sequence of calls (starting deep in the Swing event handler), via your faulty code, and maybe back into a Java API method before …

Member Avatar for bguild
0
33K
Member Avatar for cisumma

Assuming you have done nothing bizarre with class loaders, this code snippet, running in an instance of a class loaded from the jar, gives you a File reference to the jar file... File jarFile = new File(this.getClass().getProtectionDomain().getCodeSource() .getLocation().toURI()); From that you can easily get a reference to any other dir …

Member Avatar for cisumma
0
555
Member Avatar for Neon Tetras

It seems to me that the problem isn't in the code, it's in the design of the GUI. In general you can't neatly make repeated selections or delete errors just by making selections in a list of choices. At the very least you could have "Add" and "Delete" buttons which …

Member Avatar for Neon Tetras
1
169
Member Avatar for sk8ergirl

You can't. An array size is fixed when it is created, and cannot be changed. All you can do is to create a second array of the right size, copy all the entries into that one, point any reference variables to the new array, then allow the original array to …

Member Avatar for JamesCherrill
0
265
Member Avatar for firdousahmad
Member Avatar for JamesCherrill
0
78
Member Avatar for sushants

Why Java is platform independent? Because it's sometimes a very good thing to be able to write and run the same software on Windows/Linux/Mac. And how to set path in Java? That depends on which platform you are using (which demonstrates the practical limitations to complete platform independence!)

Member Avatar for stultuske
0
107
Member Avatar for zxz

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. 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 …

Member Avatar for stultuske
0
283
Member Avatar for riahc3

See the Java Language Spec 14.14 - it makes this very clear... http://docs.oracle.com/javase/specs/jls/se5.0/html/statements.html#14.14

Member Avatar for deceptikon
0
183
Member Avatar for Cyairak

Hello Cyrairac Did you have a question relating to that code? It's not clear why you posted it.

Member Avatar for JamesCherrill
0
142
Member Avatar for mjbor1

When you add lines etc in your mouse handler there's no way for Java to know that this will affect the way the panel is painted, so the paintComponent won't get called. After updating the Lines etc, call the repaint(); method for your drawing panel, so Java will schedule an …

Member Avatar for mjbor1
0
309
Member Avatar for Maryooma1

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 doing your homework for you. DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence …

Member Avatar for JamesCherrill
0
204
Member Avatar for london-G

Java has two Date classes, one in java.util (that's the normal Java Date that connects to Calendar etc) and one in java.sql (that's the SQL-compatible version). Both classes have methods to get and set their value as a long, so you can use a long value to convert easily between …

Member Avatar for kieuvantruyen
0
4K
Member Avatar for andymarin

If you look at your actionPerformed method it simply instantiates a new Bingo, Adivina, or Blackjack by calling their no-args constructors when the appropriate button is pressed. All you need is a no-args constructor in each of those classes in which you create the window and make it visible.

Member Avatar for andymarin
0
709
Member Avatar for Varunkrishna

You can tell for yourself if it's right or not by *testing it* Why do you hope it's **not** right?

Member Avatar for bguild
0
228
Member Avatar for the_ yuo

Hello the_yuo You keep saying what you want. You are not prepared to try the excellent advice you have been given, so you do not understand how your existing code works. let alone understand how to change it. Unless you are prepared to show some effort in trying to help …

Member Avatar for chetas
0
304
Member Avatar for fffttt

The Oracle tutorials tell you everything you need. Start here:: http://docs.oracle.com/javase/tutorial/uiswing/index.html

Member Avatar for JamesCherrill
0
80
Member Avatar for Violet_82

There's no problem using an s format for enums - print will actually use the enum's .toString() anyway, so you can use a fixed-width string format like `printf("| %6s | %6s | %6s |", board[0][0], board[0][1], board[0][2])` Where it all falls down is if you want to center the shorter …

Member Avatar for Violet_82
0
237
Member Avatar for mike.woeber.5

I think there's no easy answer to this one. You may be better off with some advanced OS-dependent macro system?

Member Avatar for mike.woeber.5
0
150
Member Avatar for somjit{}

NEVER NEVER NEVER ignore an exception when writing or debugging code! Java has created an instance of SQLException packed full of debugging info for you, and you have chosen to ignore it. Bad move. Repeat after me: `e.printStackTrace() e.printStackTrace() e.printStackTrace() ...` :) J

Member Avatar for somjit{}
0
225
Member Avatar for somjit{}

Calls to instance methods are resolved at run time, so when you call addAll or add from an instance of InstrumentedHashSet the JVM looks for versions defined in InstrumentedHashSet, and only looks for them in HashSet if they are not overridden in InstrumentedHashSet (unless you explictly use the super keywod …

Member Avatar for somjit{}
0
176

The End.