7,116 Posted Topics

Member Avatar for Mauricejude1

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
98
Member Avatar for sam.ndhlovu

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
46
Member Avatar for Neversleepin

We don't know what a Layer is here, but it obviously has a name field that's accessed via its getName method. That's used as part of the file name, ie the file name is made up of three parts: whatever is in the variable fileName, followed by whatever the layer.getName() …

Member Avatar for JamesCherrill
0
182
Member Avatar for babi.meloo
Member Avatar for waf4hmad

This is your first post, so you get some extra tolerance, but the code you posted did not produce the output you said it did. If you want our help you must start by being honest with us.

Member Avatar for waf4hmad
0
2K
Member Avatar for taylor.mitchell.353

Just had a very quick look - but shouldn't the while on the first line 4 be ` while( ! current.next.getStateName.equals(key.getStateName))` (as you coded it, if the first entry doesn't match you will immediately exit the loop)

Member Avatar for taylor.mitchell.353
0
122
Member Avatar for jockfaire

DaniWeb Member Rules 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. Be specific.

Member Avatar for jockfaire
0
112
Member Avatar for Hemanth.Satkuri

From Java 1.6 onwards you can directly call JavaScript code and pass values and object in and out of it. But for the specific case of mailto you can simply use the Desktop class (Java 1.6 or later) and put the whole message in a URI and call the [mail](http://docs.oracle.com/javase/6/docs/api/java/awt/Desktop.html#mail%28java.net.URI%29) …

Member Avatar for Hemanth.Satkuri
0
103
Member Avatar for 1bung100

YouTube Terms of Service, section 5B says: > You shall not download any Content unless you see a “download” or similar link displayed by YouTube on the Service for that Content. You shall not copy, reproduce, distribute, transmit, broadcast, display, sell, license, or otherwise exploit any Content for any other …

Member Avatar for JamesCherrill
0
2K
Member Avatar for paidah

DaniWeb Member Rules 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
143
Member Avatar for aabbccbryanmark

You really should get a programmer's editor and clean that code up - proper consistent indentation would make this kind of problem obvious. Anyway, I count four "if ... {"s, but there are five "}" before the else, so that's the error.

Member Avatar for JamesCherrill
0
128
Member Avatar for rahul.ch

"do" is a Java reserved word - just like if, class, while, return etc etc You can't use a reserved word as an identifier. You could change it to "doh" - that would seem appropriate :) http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html

Member Avatar for rahul.ch
0
199
Member Avatar for phovasia

1. This is a 6 year old thread - the OP has certainly moved on by now 2. Which version are you referring to when yo say "This version"

Member Avatar for JamesCherrill
0
223
Member Avatar for poojavb

mKorbel's advice is good. Unlike KeyListener, a DocumentListener will correctly deal with copy/paste and programatic changes to the text. as well as anything the user types

Member Avatar for JamesCherrill
0
3K
Member Avatar for babi.meloo
Member Avatar for JamesCherrill
0
2K
Member Avatar for reenarankawat
Member Avatar for techxaidz

The complex statement on line 1 could be going wrong in a number of places. Break it up into separate statements and print the result at each step to confirm what it is really doing. Similarly, print the results of the readUTF to confirm exactly what that is doing. You …

Member Avatar for JamesCherrill
0
118
Member Avatar for linezero

When parsing you may find [this](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html) useful

Member Avatar for JamesCherrill
0
306
Member Avatar for philo.meena.1

@phile.meena.1 You are creating some confusion here. Please explain in a LOT more detail what you want to do. Right now it sounds like "I want to develop a full-size commercial database application in Java and I don't know anything about programming" - in which case you should allow at …

Member Avatar for JamesCherrill
0
138
Member Avatar for Kayla1993

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 include: "Do provide evidence of having done some …

Member Avatar for JamesCherrill
0
174
Member Avatar for strizh
Member Avatar for stultuske
0
182
Member Avatar for alanso

@alanso: Please try to be sensible. You have told us that you have "a lot of errors" in some code that you haven't posted. How do you think anyone can possibly help you with unknown errors in unknown code? In your next post you need to post the exact complete …

Member Avatar for stultuske
0
234
Member Avatar for godaged

> ... insisting that the rating supplied by the user be valid. > rating should be 1 to 5; The first verion does not even try to do this, so it cannot be right. The second version does, but it has a logic error in the if test, which you …

Member Avatar for godaged
0
198
Member Avatar for mukororokudo

Yes, we'll help, but you need to show some effort first. Post what you have done so far. DaniWeb Member Rules 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 Taywin
0
209
Member Avatar for challarao

The official Java documentation is always the definitive place to look. [Here's](http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.5) what the Java Language Specification says about how an instance is created and initialised

Member Avatar for JamesCherrill
0
302
Member Avatar for don.fck.wit.cleeve

near line 51, where you keep track of the highest score, you can also update a String variable to store the name associated with that score. Then hyou can print that variable after the loop.

Member Avatar for JamesCherrill
-1
488
Member Avatar for Yoink

deck1 is a single object, it is NOT an array of cards. It happens to contain an array of cards, but that's not relevent except to how it's printed out. So deckArray is an array list of 1 element, an instance of Deck. When you remove that 1 element the …

Member Avatar for JamesCherrill
0
868
Member Avatar for aabbccbryanmark

You declare totalPur inside the loop, so you get a brand new totalPur each time thru the loop and the previous one(s) are forgotten. Declare and initialise it *before* you enter the loop so the same variable is used throughout.

Member Avatar for aabbccbryanmark
0
3K
Member Avatar for love.emeter

Line 34 you are assigning the value of true to the variable stop. The test for equals is == You may also be blocking the Swing event dispatch thread depending on what the restof your code looks like. Everything to do with Swing (eg painting the screen, running actionPerformed methods) …

Member Avatar for love.emeter
0
294
Member Avatar for taylor.mitchell.353

Splitting on blanks is not such a good idea. The file format is defined by columns, so that's how you should parse it. Splitting on blanks will fail if any of the data fields contain an embedded blank, eg San Juan on line 3. The best answer is to substring …

Member Avatar for JamesCherrill
0
158
Member Avatar for sephzy

public static String createID(C) That won't compile becuase when you define a method you have to say what type the parameter is. You can save a lot of time by trying to compile your code and fixing as many errors as you can before posting here and waiting for someone …

Member Avatar for JamesCherrill
0
328
Member Avatar for raider650

This thread was finished 3 years ago. It's interesting, but far too late to contribute now. Thread closed,

Member Avatar for JamesCherrill
0
2K
Member Avatar for mikewyatt

You could override paintComponent to paint the background yourself, then draw the tile repeatedly in a nested x,y double loop to tile it across/down the whole area. You could optimise that by doing it once to a new full-size image if necessary, but it probably won't be necessary.

Member Avatar for mKorbel
0
85
Member Avatar for Viped

Create a new buffered image. Get its Graphics. Draw your canvas on the Graphics. (Use your existing paintComponent method and pass the BufferedImage's Graphics to it.)

Member Avatar for JamesCherrill
0
423
Member Avatar for Yoink

Maybe put them into the array starting at the end and filling backwards? ie keep deck[x] = new Card(rankValues[j], suitValues[i]); but start x at 51 and decrement it in each pass of the inner loop instead of incrementing it. ps When you have an answer to a problem please mark …

Member Avatar for Yoink
0
280
Member Avatar for Yoink

Your enums store the text you need (eg "Ace", "Spades"), so all you need is an accessor method in the enums to return that text (or simply override toString in the enums to return it)

Member Avatar for Yoink
0
692
Member Avatar for khalidshakar

Here's what the Java API documentation has to say: > stop() > Deprecated. > This method is inherently unsafe. (...) Many uses of stop should be replaced by code that simply modifies some variable to indicate that the target thread should stop running. The target thread should check this variable …

Member Avatar for khalidshakar
0
307
Member Avatar for Julie29

There are quite a few syntax errors there - missing () etc. Compile your program to get a list of syntax errors and fix them (start at the top and re-compile after each one, as an error early in the code can disrupt parsing of the code that follows). Then …

Member Avatar for JamesCherrill
0
7K
Member Avatar for slimergan

If you want it to look good, here's how you do it: Create an image file (jpeg or whatever) for the junction, and one or more small image files for the car(s). Program a JPanel with your own paintComponent method. In that method draw the junction image on the JPanel, …

Member Avatar for JamesCherrill
0
1K
Member Avatar for randmateweb

The improvements in 1.7 are no big deal over 1.6, and many corporates take forever to update, so I wouldn't worry about that. If you're happy with the core concepts I would recommend writing as much code as possible and getting feedback (eg from here) rather than just reading about …

Member Avatar for JamesCherrill
0
140
Member Avatar for abinaya.lingam

PritiP Please read the DaniWeb member rules before posting - it helps to keep our web site well-organised. DaniWeb Member Rules include: "Do not hijack old threads by posting a new question as a reply to an old one" http://www.daniweb.com/community/rules Please start your own new thread for your question This …

Member Avatar for JamesCherrill
0
365
Member Avatar for rahul.ch

pwd is defined as a Long, and a long will be auto boxed when assigned to a Long...

Member Avatar for rahul.ch
0
235
Member Avatar for rahul.ch

When you have something like ` void met(List<? super Animal> l2)` you are saying that the parameter will be a List of type "x"where "x" is Animal or a superclass of Animal. Note that at compile time you don't know what "x" will be exactly - it could be Animal, …

Member Avatar for rahul.ch
0
337
Member Avatar for NewGuy2Prog

I haven't read all that, but it certainly looks like pretty good code. One point: you use equals when looking for a given object in the list. Are you sure that's what you mean? Equals may return true when the object is a different object but the writers of that …

Member Avatar for JamesCherrill
0
174
Member Avatar for Darshan5

No, you don't ***have*** to use KeyListener. mKorbel's advice is good. Apart from anything else his approach will also handle copy/paste into the field correctly. It also uses classes that Sun/Oracle have already written for this purpose, so no need to re-invent the wheel.

Member Avatar for JamesCherrill
0
189
Member Avatar for ownedbynothing

(At least) two approaches: 1. Make each image an imageIcon in a JButton and use an ordinary ActionListener for the buttons. Chose a suitable button margin to make it look good. 2. Add a MouseListener to the panel where the images are drawn and use th x.y coords of the …

Member Avatar for mKorbel
0
599
Member Avatar for utchia

for (int i = 0; i < comix.length; i++) { Scanner console = new Scanner(System.in); String temp = console.nextLine(); Your problems start here. Your loop starts with i = 0. It gets the search word from the user, and tests the first element of comix. It then goes to the …

Member Avatar for Taywin
0
234
Member Avatar for gorgoro

As a new employee you are unlikely to be asked to do a new project. New hires are usually assigned maintenance tasks, mostly because that teaches them about the existing systems, and partly because they are bottom of the pecking order and nobody likes maintenance. So a typical task may …

Member Avatar for gorgoro
0
269
Member Avatar for lj81

Is there a Player class? Does it have get/setColor methods? Is the color initially null? Why not just have a test in the potting logic that says if ball is yellow or red AND player1.getColor()==null, call setColor as appropriate?

Member Avatar for lj81
0
265
Member Avatar for KarimFawaz

Line 56 - has an incorrect ; - just delete it public static void main(String[] args) { // method body }

Member Avatar for JamesCherrill
0
186

The End.