Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Actually, no, I don't think that is in the same vein as what he is trying to do.

Also, please format posted code with a little more attention to readability and code conventions, as it will make it much easier to follow.
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> - Fake science in globbal warming.
Completely ignoring legitimate climate change science.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Because you are trying to call methods on the class that you have not written. Those methods don't exist in the code that you posted.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

thanks for the suggestions guys, but note cards? Is there an advantage to these over notebooks/pads? I tend to prefer the latter.

Note cards are a bit sturdier and smaller, which make them a little more portable and less inclined to be wrinkled up and destroyed. But really, use notepads if you like them better. The point is really just to find a system that works for you within your own habits and preferences.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yeh wth is that about? I don't hate my parents. I'm grateful; the spanking kept me in line. And its not like I was spanked and I didn't know wth it was about. Everytime I was spanked they explained why.

Same. I don't resent my parents at all for the spankings I received. It was used under specific circumstances that were clearly understood.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

bob, facts that would support less crime and violence in some previous generations may be entirely valid (though debatable due to data collection means and usage differing from those today), but it still does not directly support as assertion that spanking had anything to do with those figures. Perhaps they did, but your data certain can't prove it. It remains a speculative relationship.

That doesn't mean it's an invalid speculation, but to get your back up over dispute with your "facts" is merely ignoring that those facts are not directly relevant. Huff and puff all you like, objectively it still boils down to mere assumptions that heavier-handed discipline instilled more civil and moral behavior. Perhaps it did, who knows, but chances are it was also influenced by other cultural changes beyond mere spanking.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Hi Ezzaral, Frederik, all,

I don't think I can use the getImage() method as I have to use swing to build my interface. So getImage() isn't defined for my ImageLoader class, as it is a child of JFrame. Any other ideas??

You can add any method you like to ImageLoader - it's your own creation. The entire reason for extending a class is to add additional functionality to it. That said, I still don't see why ImageLoader should extend JFrame for that matter. What does image loading have to do with a frame, especially if you are using it to load an image to place into a different panel class?

Using Swing for your application in no way implies that every one of your classes needs to extend a Swing component. Most of your classes will be dedicated to handling state and behavior that is completely independent of a visual presentation component.

Is ImageLoader supposed to do anything except get an image from a file? If not, then it really doesn't even need to be a class at all. Just make it a method in your other class that returns an Image for a given file name parameter.

g_loughnan commented: Helpful! +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Loose outline form, briefly summarizing notable concepts in your own words on note cards with the page number included for easy reference later.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

People who keep saying hypothetically

I can see how that would be annoying, if they just kept repeating "hypothetically hypothetically hypothetically ..." over and over and over. I think it would annoy most anyone.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

thin ice Ezzaral ;)

Heh, I heard that all the time growing up.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

the word "jesting" annoys me. :icon_evil:

Only jesting with you!! :P

oh, people who answer rhetorical questions. :P

Me too. Don't they have anything better to do? (*whisper* that's rhetorical...)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Really drives me up the wall when people get sarcastic to prove a point

Agreed. Making every argument into a nursery rhyme would suffice, but some people just have to push it. Damn, those people get under my skin.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That means if you do the opposite of smiling, you look uninsane or normal.

Or possibly suffering intestinal distress, but it's a hard call to make.

Ezzaral, you sound like a real fun dude to me, chapped lips and all.

Oh, it's just a little bit chapped from the wind, not badly, but your concern is appreciated :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Abusing big words that do fit is far better.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Don't you just dislike people that use cliches and big words when there is no substance.

Unequivocally preposterous insinuation.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

When I walk into a room, I always smile. Even though I look kinda funny when I smile, it makes you noticeable, like you're fun, like you're somebody...

... or like you are insane...

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Today - just for fun - try smiling more

Hmm, not so much fun with a chapped lip:(

- give somebody a hug

That's a sexual harassment suit begging to happen

be honest with yourself

Lying to yourself might make the smiling part easier

- look at leaves

on the ground in dead piles

, a tree,

bare of said leaves

ants

Hrmm, not really sure where the ants go in the winter. Cuba perhaps?

and see the magical creation in all of life

I thought I saw a unicorn, but it was just a fat lady in a white track suit chewing the end of a carrot:-/ .

Just for today - look in the mirror - take a good look into your eyes and thank God for who you are.

Don't believe in the god thing. Can I thank my dog instead?

Tell yourself how much you love - You

Might raise an eyebrow with my wife

Not in an ego sense.

A id sense? Non-sense?

Much Love

Right back atcha there, Stuart;)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

beats dropping bombs on all those poor folks!

Those are bombs of love.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I told my friend I love him and he said "that's nice but I'm not interested".

Yay for me *shifty*

Hehehe, try it on the mail carrier next :) Perhaps the grocer after that. Guaranteed to illicit all kinds of fun reactions.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Saying "to be honest"

As opposed to?

"Just lying so you'll shut up and leave me alone, ..." perhaps - but that doesn't really go over as well when you state it right out like that....

Or "it's always in the last place you look". Well duh, you're not gonna look for it when you've found it!

That's kind of the point. It's just a tongue-in-cheek jest. Surely not all jesting annoys you?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your ImageLoader needs a getImage() method that returns the Image object. Then it's just a matter of calling imgldr.getImage().

You seem to have nested the classes more than necessary, but that may just be the way you pasted in the code. Anyway, if you want to construct an ImagePanel with the image, you will need to write that constructor in your ImagePanel class as well.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

And anyone who wants to claim that I am being "absurd" better do THEIR homework.

None of your data shows any causal relationship to spanking though, so despite all the caps-lock words you want to sprinkle about, it still remains unsupported speculation.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The changes will not be automatically saved into the file that you parsed the document from. You have to write that in-memory DOM back out to the file yourself. See the following tutorial section on how to do that:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPXSLT4.html#wp64603

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I don't think you will be able to run an Access database within a jar. You will need to unpack it to a local directory.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you just want to return an element if a certain value matches either of two fields, all you really need to do is this

public KasseInterface søgVare(String value) {
    for( KasseInterface elem : varer ) {
        if (elem.getVarenummer().equals(value) || elem.getVarenavn().equals(value)) {
            return elem;
        } 
    }
    System.out.println("fandt ikke nogen vare!!!");
    return null;
}
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

So, will the man in the big red suit be leaving you something nice?

If I find a strange man in a red suit in my house, the only thing he will be leaving is what can't be scraped off the wall.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Getting coal might not be so bad at all these days.

Until you got a bill for the carbon credits :-/

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

As you've probably noticed, JSpinner does it's own thing with the mousePressed and mouseReleased events internally, so your added MouseListener doesn't respond to these. This leaves you with working through the ChangeListener alone. Adding a timer to poll for changes and checking for a minimum time between changes, you can limit the response like you are wanting to. Here's a ChangeListener you can add to the spinner to handle this

private class SpinnerListener implements ChangeListener, ActionListener {
    // minimum time in ms between update requests
    static final int MIN_TIME = 100;
    long lastChange = System.currentTimeMillis();

    boolean valueChanged=false;
    Timer repeatTimer;

    public SpinnerListener(){
        // timer polling every 50ms
        repeatTimer = new Timer(50, this);
        repeatTimer.start();
    }

    public void stateChanged(ChangeEvent e) {
        valueChanged=true;
        lastChange = System.currentTimeMillis();
    }

    // action called by timer
    public void actionPerformed(ActionEvent e) {
        if (valueChanged && (System.currentTimeMillis()-lastChange)>MIN_TIME){
            // call your update routine here
            System.out.println("updating stuff");
            valueChanged=false;
        }
    }
}

I arbitrarily chose the timer interval and the MIN_TIME constraint to balance reponsiveness of the update call. You can play with those a bit if you need to tweak the delay.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You didn't show the method signature of your discard() method, but is sounds like you coded it discard(card[]) instead of discard(int).

If you can post the code for the discard() method, it would be helpful.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

1. for ( i = names.length-1 ; i =>0 ; i--)
-->names.length()-1

You are thinking of the String.length() function. In his case, "names" is an array and names.length is correct.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

lol, havnt u got anything better to do u loser.ahh is this ur whole life,bless. i could easily complete this task myself, but thought i'd get someone else to check it out for me first.

No, it's not our whole life, but many of us do volunteer a lot of time trying to help those who genuinely wish to learn to program. Some do come along though who only wish for someone else to do their thinking for them and the worst of them have a misguided sense of entitlement. Those individuals really don't even deserve the time it takes to type a response.

Obviously, you cannot easily complete this task or you would have done so by now without help. Good luck finding some assistance with it elsewhere.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you're going to claim it's a massive lie, then would you please point out where it is, in fact, testably inaccurate?

In the theological aspirations, which you will note, are by definition not testable and wholly lacking in evidence. Though perhaps it is a wealth of historical chronology, that is not the reason Christians cleave to it. The ascriptions of causality to a deity and admonitions to adhere to a code of conduct set forth by said deity is the part that is lacking in credibility.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yeah i'm short sighted. Need glasses to legally drive.

hehe, you may want to say near-sighted instead. Short-sightedness is a bit more debilitating and unaffected by eye glasses. :P

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

So, for example, if the Bible were to be a contrivance, put together from fantasy rather than fact (to whatever degree) how big a lie would that be?

I would wager the biggest lie every perpetuated in history.

In fact, I believe that to actually be the case.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

people smoking makes me irritated

So don't go near them.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Please refer to the announcements at the top of the forum. Homework help is only given to those who show effort.

Come back with some code indicating effort and specific questions regarding what you are having trouble with and perhaps someone can help you.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Imagine, and all you did is move the letter n.

Imagine, differing placements of letters create different words and perhaps wholly unrelated concepts...
:-/

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Democrats controlling the economy.

More of Midi's ultra-right, "liberalphobic" inane blather.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you take a look in your JDK installation folder under "demo\jfc\TableExample", there are several table example programs, including a TableSorter.

I've also attached a zip file containing a JSortTable implementation from Java Pro magazine. I was going to link to it in the archives, but it seems Java Pro got swallowed up by another company and I can't locate the archives.

Edit: Oops, guess you found something hehe. Didn't know they had rolled that into the api in 1.6.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, you might get something to work using Robot, otherwise you would need to use JNI to access the win32 API.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

javaAddict is correct. You have not initialized the component variables.

The stack trace indicates this is occurring on line 14 in your constructor, so that is where you would want to look first to debug the error. Learning to read the stack traces will save you a lot of time and frustration in finding the errors in your program. It's well worth to the time to study them closely and look up the exception that it is reporting in the API documentation.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@Ezzaral..

thanks...it was a silly mistake..it worked...

well i want to ask one more question ...i m using jCreator for this...if i want to run it using command prompt i have to change the directory to bin folder of jdk everytime i run cmd...

how can i set path for this forever...

Add your Java /bin folder to the system path in your environment variables. This is described in more detail here if you need it: http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html#Environment

@Ezzaral
well one more thing i wanna ask
why didnt it give a compile time error...

It did not complain because your method was still a valid one - just not the one that you wanted to override. You supplied an new method called pain() and the compiler was just fine with that.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Have you run it? Did it work correctly?

It seems like you could tell on your own if it's working or not. If it's not, then post specific questions about what is not working correctly.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Man is common to both God and dog.

Maybe, as dog is man's best friend, so is man God's best friend?

Man created that relationship with the dog... and perhaps the one with gods?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I find it interesting. No reason in particular, it is just interesting.

And what of the spelling of god and dog?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> public void pain(Graphics g)

I think you meant to type "paint" here instead of pain. :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Just put a loop on the first dimension of the array around the code that reads the input line.

Also, main() should not throw Exceptions. Learn to use try-catch blocks.
And read this as well: http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Do not use Vector even if you need a synchronized list. Use Collections.synchronizedList(List) or CopyOnWriteArrayList.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you run a search for "JTabbedPane background", you will find others have had the same difficulties. The UI provided by the look and feel you are using may not allow you to change the color of the tab itself. Some have gotten around this by subclassing the UI provided by the look and feel and providing that behavior on their own.

These two threads might help:
http://forum.java.sun.com/thread.jspa?threadID=447837&messageID=3795122
http://forum.java.sun.com/thread.jspa?threadID=461656&messageID=2121255

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You may want to look at this bug report:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4765247

Depending upon which look and feel you are using, the behavior of the background color for JTabbedPane may vary. I ran across several threads regarding this behavior.

If you only want the content area of the tabbed pane to be a certain color, you can set the background color of the component in that tab (JPanel or whatever) to the desired color.