Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

j+6 is not what I wrote above. That is quite different than length-1.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I guess in all your research you never bothered with this?
http://lmgtfy.com/?q=java+speech+api

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The example you gave above was already sorted from most to least wins. Pairing the teams is one simple loop to the middle of the array, selecting the "i"th element from either end of the array. I wrote out those array indexes in my last post. If you produced
UNCC VS.UNCC
NCSU VS.NCSU
then you obviously did not grab the elements that I described.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to select the first and last elements from the array: [0] vs [length-1] The second pairing is the second element and the next to last: [1] vs [length-2] This repeats until you reach the middle of the array.

All you have to do is create the loop for that progression. It is a single loop that terminates halfway through the data set. Your loop index is all you need to select each pair of values because they step in at the same rate.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You resurrected this thread from the grave to ask others to correct some code you found on the internet and send it to you?

Amazing.

I don't think so.

Closed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Write down the index values for the first and the last. That is your first pairing. Then write the next pair of indices. Note the values that need to be incremented each time as you loop to the middle. It is not j and j+1.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You only need a single loop through games[] to pair the teams. You just step in from the ends evenly as you loop, so first pair is 0 and length-1. Think about the loop you need to select the rest based on that progression to the middle.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Megadeth - "Holy Wars... the Punishment Due"

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Wow, that's a totally pathetic thing to do.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Many here are willing to help, but you have to put in the effort to work through the problems. You have to ask about specific things and post your progress as you work through the issues.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That is your assignment - not a question.

Be specific. Post what you have started with and describe what you are having trouble with.

No one is going to simply do this for you.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Post your question.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why are you getting 'exam_fee' when you called the column 'total'?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You forgot to post your code (Be sure to use [code]

[/code] tags)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Disarmonia Mundi - Resurrection Code

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

>Uhh...why is num=7 is never used?
Read the code again and watch the calls to nextInt(). You'll see it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I'd recommend giving H2 a look.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why should anything be done about him? I read through your thread there. You started acting like a jackass and your thread got closed. I don't see the problem as being on his side there.

Steve Nelson commented: | +0
Ancient Dragon commented: offset previous negative rep +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why not ask them then? If they "helped", they should be able to tell you quite easily what it is and why they did it that way.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You got too much time on your hands.

(Don't know who sung that)

Styx :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Hints on correcting those 3 errors: Check spelling, length is a method of String instead of a property, and you can't define the same variable more than once within a block.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Black Sabbath - "War Pigs"

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Welcome back, Narue.

Davey, best of luck with everything. Our thoughts are with you.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Actually that poster does not have any sig links. Apparently he just likes to make absolutely useless comments in other people's threads. I didn't see a single post that added any relevant value.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Threads merged.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

harinath, obvious you did not read the rest of the thread. She fixed the error.

Your own code has logical errors - it's returning the wrong boolean value and it's looping twice over the same range.

As far as the return within the loop, that is just a choice. It can be done there or at the end. Either is valid. Personally I would return directly from within the loop, but some people prefer to have a single return point at the end.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes sorry, I managed to cross-post while you were posting that you'd figured it out.

Did you catch my edit about using HTML to create multiple lines in your label? You can use <br> to separate them.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use JList.getSelectedIndices() to get all of the selected indices.
Edit: Cross-posted. Use html in your label to generate multiple lines.

sariberri commented: Thanks for replying :) +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Alright, thanks, but no thanks. You don't need to clutter up other peoples' threads with schizophrenic nonsense.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It was snipped for this reason: http://www.daniweb.com/forums/faq.php?faq=daniweb_policies#faq_keep_it_spamfree

jingda is asking you to violate the forum rules.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can add a break statement after found=true as well. There is no reason to keep looping once found.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

>so please give me suggestion as soon as possible
My suggestion: Get started.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You ask for blessings and have this in your sig?
> "It is not sufficient that I suceed - all others must fail."

Under such a doctrine we should be hoping you fail.
(You also misspelled succeed)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

... we now return you to your regularly scheduled reality.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ezzaral dear, what you say the decision i have made is not right or not too good............. ?

I'm saying neither of those. I'm just mentioning another option. Many start with Java. It is also a good general purpose language that is widely in use.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

A lot of people also start with Java as well.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Are you actually using the AWT List component? JList doesn't provide methods to add ActionListener or ItemListener.

JList just uses the ListSelectionListener which behaves a bit differently.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can set a flag while you are altering the contents of the control, such as initialized=false; and then set it to true when you are finished. Your listener can simply ignore events while you are updating the contents by checking that flag.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You should change the declaration to use Measurable instead of Quiz.

> Given that Quiz implements Measureable there should not be an error
Well, in this case he could explicitly cast the Measurable back to Quiz because he knows that is what he supplied to DataSet, but it wouldn't be a good idea. The entire point of using the interface is to deal with a certain contract of behavior without regard for the class that is implementing it.

It's more appropriate to use the interface type here.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Either populate the list before you add the listener or set a boolean flag initialized and check if (initialized) {... in your listener.

Edit: You may check to see if ListSelectionListener works better for your needs also. I wouldn't think that one would fire any event as the model is filled.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, it is a duplicate. Closing this one.

Please refer all further discussion to the other thread http://www.daniweb.com/web-development/php/threads/357856.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Just move the addListener() code up into the constructor. You can still call repaint() the same way.

edit: You may want to consider using Swing JFrame and JPanel classes instead of Frame and Canvas unless there is a reason you need to stick to older awt classes.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

So what is your question? Dumping some code that you found on the internet and can't compile isn't really what we mean about showing some effort if you expect to get any help.

> need a code tht ...
You've come to the wrong place if you expect anyone to just hand you code.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You are adding the key listener in your paint() method. Every time it gets called, you add another.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Move your declaration of ArrayList<String> studentArray up to the class level, instead of within your readFile() method.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Are you sure you haven't added the listener more than once? Because that is kind of what your output looks like. I don't see anything wrong with your listener code itself.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Dispose() the frame you want to close and setVisible() the one you want to open.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It's no different than displaying any other data set in a table. Create a table model that returns the values for a given cell. You can do that any way that you wish - a single result set from a query, two individual result sets that you manage by index, etc.

The table model just needs a method to getValueAt(row,col) . How you return that information is completely up to you: Creating a Table Model