venomlash 55 Junior Poster

:-/ Is there any function in MouseListener that returns the x- and/or y-coordinates of the cursor relative to the origin of a JPanel which currently has the focus? ¡Ayúdenme, por favor!

venomlash 55 Junior Poster

Ooops, Ancient Dragon, my bad. Didn't see those. I pulled a noob.:icon_confused:
thanks.

venomlash 55 Junior Poster

>Does anyone know of anything in C++ that is at all like paintComponent or the Graphics class

Yes it is called using a third party graphics library.

Know of any??? Pretty please with easy-to-read, exception-handling code and a cherry on top??? I've been looking for ages, can't find any that work.:(

Thanks for the help.

venomlash 55 Junior Poster

For those of you who also code in JAVA*:
Does anyone know of anything in C++ that is at all like paintComponent or the Graphics class? HALP!


*ROFLwaffles to those who do

venomlash 55 Junior Poster

Veni, vidi, voops! I came, I saw, I tripped.

--John of Darwin Awards

Dave Sinkula commented: Chuckle. +11
venomlash 55 Junior Poster

My car is a bicycle... Woo hoo!:)

venomlash 55 Junior Poster

What is the bus driver's name?

venomlash 55 Junior Poster

You are the driver on a bus. The bus starts off empty. At the first stop, three people get on. At the second stop, 6 people get on. At the third stop, 2 people get off and one person gets on. At the fourth stop, 4 people get off and 7 people get on. At the fifth stop, 2 people get off. At the sixth stop, 3 people get off and 10 people get on.

venomlash 55 Junior Poster

How many Chelmites (fools) does it take to change a lightbulb?
Eight. One to screw in the new bulb, and seven to find some light to put in it.

How many imbeciles does it take to change a lightbulb?
Five. One to hold the lightbulb and four to rotate him.

How many drummers does it take to change a lightbulb?
Eleven. One to do it and ten to say "I think Neal Peart would have handled that differently."

venomlash 55 Junior Poster

"Skirmish" map editor. Skirmish maps are one battle only. Galactic conquest maps let you plan strategically to take over multiple planets (on land and in space) and you create your forces before, not during battle. I reccommend the Skirmish map editor highly, though it is slightly buggy. It's fun:)


*Like I say, beware of the RANCOR ---------------------------------+
|
http://www.geocities.com/Area51/Corridor/1086/rancor.jpg <---+

venomlash 55 Junior Poster

You've got Hitler, and you've got Hitler, and YOU've got Hitler, and YOU've got Hitler,AAAAAAAAAHHHHHHH!

to paraphrase Tyra Banks:P

venomlash 55 Junior Poster

I have a secret weapon: I downloaded a free user-made map pack, so I know the syntax. The big question: why don't the people who make these maps post their own map editor?

venomlash 55 Junior Poster

I like Star Wars and SW video games, Battlefront II, Empire at War, etc. I plan to write a free, unofficial map editor to create an unofficial map editor for Empire at War in order to create new Galactic Conquest maps. Anyone else like SW games? Sound off!

venomlash 55 Junior Poster

Whoa whoa whoa!!! This is what we do apart from computers! Honestly...


P.S. I launch rockets:twisted:

venomlash 55 Junior Poster

No offense, eyedea2011, but the syntax you're using is either really old or really new, because a lot of it doesn't make much sense to me. Why not just use

if(a==b){
    return true;
} else {
    return false;
}

Just an idea...

venomlash 55 Junior Poster

Of course. the other computer in my house is Windows 95, 486 processor, ~64 meg...blah.

venomlash 55 Junior Poster

512 meg is better than what I've got...256 meg, woo hoo!

venomlash 55 Junior Poster

waxyaie, I suggest you and ressi1 team up on the $ register gig.

...reason for wanting to make a cash register GUI?

venomlash 55 Junior Poster

Wow. I'd been wondering about that too...
Thank you abar_sow for asking the question and Ezzaral for answering it.:icon_smile:

venomlash 55 Junior Poster

Sorry. There's always the chance that he's working with one of those really janky compilers (like BlueJ) that show one error and say nothing about the 5,000 others also lurking in your code. But hey, I apologize for my public disservice announcement.

venomlash 55 Junior Poster

I'm personally a PC gamer & big-time Star Wars fan. Most unfair thing ever is happening. Lucasarts is about to release The Force Unleashed, the greatest SW game ever, on many platforms that DO NOT INCLUDE THE PC!!! Nooooooooooo!

venomlash 55 Junior Poster

Heh heh... nice one, Ezzaral.
Yesterday, my mom grounded me from computer priveleges and then asked me to solve a processing speed/spyware/adware problem on the family PC. Managed to negotiate half the ban off.

venomlash 55 Junior Poster

What I would recommend is checking to make sure that all methods that are not called from an object using the . operator are declared as static . Otherwise the compiler may just, oh, gosh, not run the blasted thing. Some methods didn't have static in there; I couldn't tell whether or not they were called on their own, but you should keep an eye on that. Buena suerte.

venomlash 55 Junior Poster

public class prog8{
public class static void main(String args [])

Something tells me that putting class in twice may not be doing you a whole lot of good.;)

Apart from that, I can't tell. Fix the double class goof and then report back at 0800, cadet. Dismissed.

venomlash 55 Junior Poster

I recommend Scanner highly. This will work nicely if:
a. you replace the commas w/spaces and use nextInt() b. you keep the commas, use next() , and set up an elaborate system to trim the commas out of the String s made and convert said String s to ints
I'd go with "a".

venomlash 55 Junior Poster

¡Vaca sagrada!
You're trying to write (on and for a computer) a cash register program that would work if it were run on a cash register...it won't work so well unless you have the proper peripherals.
You might be eating at McD's too often if you have become enamored with their cash registers.

...unless you're interested in money stuff in general, in which you just like $, and who doesn't?

venomlash 55 Junior Poster

RPG all the way!!!

venomlash 55 Junior Poster

seriously...GID*


*Get It Done (courtesy of Chris Livatino)

venomlash 55 Junior Poster
masijade.Statement()=true;
you need to post your code so that switch(we can){
case a:
    find out where you goofed;
    break;
case b:
    know you're not just getting Daniweb to do your work for you;
    break;
}
while(stillConfused()){
    recommendVenomlash="nCr";
}

:icon_cheesygrin:

venomlash 55 Junior Poster

What is the best compiler for JAVA? BlueJ, Eclipse, or what? Opinion, please...I'm kinda lost.

venomlash 55 Junior Poster

Try C# sometime. I hear it's halfway between JAVA and C++, so that might be useful. Personally, I'd say C++ is easier to work with; strings are mutable, you just have to type cout instead of System.out.print, and many other little things that make coding easier. Of course, I know very little about coding, so hey...:icon_mrgreen:

venomlash 55 Junior Poster

I always learned that main returns an int so that you can put exit(0) , exit(1) and other constructions in to tell you why the program quit. Or would that not work...?

venomlash 55 Junior Poster

I agree with thegathering, the best way to make a chat program is usually to write inputted lines to a .txt file. This not only works very smoothly but can also be tooled to archive chat lines as well. Good luck! :cool:

venomlash 55 Junior Poster

How does one use an interface? The paint interface in particular?
¡Ayúdame, por favor!

venomlash 55 Junior Poster

Is there any way to write a program to check a computer's serial number as sort of a copy-protect? (i.e., if the serial number doesn't match the expected number written into the program, the program quits.)

Anyone know?
Thanks,
venomlash

venomlash 55 Junior Poster

Create a

bool list[50]

, an array of 50 boolean (yes/no) values and set all of them to true at the start by using a for loop. Then, create the following function:

int randnum(int num){
    return rand()*num/(RAND_MAX+1);
}

Then, inside the body of your program, write the following:

int printnum;
for(int i=0; i<50; i++){
    printnum=randnum(50);
    if(list[printnum]==true){
        list[printnum]=false;
        cout<<printnum+1<<endl;
    } else {
        i--;
    }
}

If this doesn't work, tell me.
Venomlash

venomlash 55 Junior Poster

Like evilsilver said, rand isn't really random. It uses a really complex algorithm on the seed number (which you set with srand), so every time the program is run, it gives you the same output from the same algorithm with the same input. Try putting a srand([something]) inside the for loop and try again.

venomlash 55 Junior Poster

Try making a vector of Tree*, and add elements which are Oak* and Elm*. Of course, this means you'll be working with pointers, but I'm assuming that you'll be fine with that...

Huh? What's a pointer? I can only write basic code? Please tell me what a pointer is? Apparently I can't stop using question marks?
Venomlash?

venomlash 55 Junior Poster

Venomlash back again.
Wrote a code snippet, compiler didn't like it. The pain, the pain, the pain. Of course, it might just be that I'm not good with inheriting classes, so anyone who can get this to work, good job!:!:
Byyye!

venomlash 55 Junior Poster

If I create a class called "tree" and inherit from it to classes called "elm" and "oak", can I, using all three header files, create a vector <tree> and use push_back to add an "elm" and an "oak" to that vector?

venomlash 55 Junior Poster

Again, it depends on which country you live in. Not all keyboards have a & key!!!! Actually "and" looks a lot more readable than "&&". Dev-C++ uses a much more international open source GNU compiler. Thank you GloriousEremite for the reference site!

Please tell me you're kidding about the keyboards lacking an ampersand! I have never heard of that. Just to connect this to something funny, has anyone seen the Dilbert strip in which the company accidentally ships keyboards lacking the letter Q, marketing them under the slogan "The Big Q of Quality"? Bizarre, eh?
Venomlash

venomlash 55 Junior Poster

I use Bloodshed Dev-C++ version 4.9.9.2 and it is a little weird in that it accepts "and" as "&&" and "or" as "||", not to mention not requiring parentheses around separate clauses in and/or connected statements. Therefore it would read the following as the same.

if(voice==loud or voice==annoying and voice==whiny){
cout<<"SHUT UP!"<<endl;
}

if((voice==loud) || ((voice==annoying) && (voice==whiny))){
cout<<"SHUT UP!"<<endl;
}

Strange, huh?
Venomlash

venomlash 55 Junior Poster

Quote:
"...my computer says it doesn't have i0stream and several other headers..."

Did you maybe put in i0stream like you did in your message? Stupid question, but it only takes iostream.