When i press the friend button, it gives me the pop up and then it dissapears.

05-15-2011, 02:04 AM

Fubarable

I can't see what you're doing wrong, and because of this I recommend that you create and post a small compilable program that demonstrates your problem, an SSCCE. If you go this route, I suggest that you use images that are readily available to us all online, and some that I've used for this purpose can be found here: Duke Images

Here's an example of an SSCCE that uses the public domain internet images:

thats the whole code, i do not know how to use images that are online. I only know how to use ones that are in the folder. If you guys can just rename couple images to fit my names it should work for you.

05-15-2011, 02:21 AM

Fubarable

Quote:

Originally Posted by Bagzli

[CODE]package Game;thats the whole code, i do not know how to use images that are online. I only know how to use ones that are in the folder. If you guys can just rename couple images to fit my names it should work for you.

Others may have time to wade through the whole program, but I'm a bit pressed for time myself given my work and family obligations. If you're still stuck and without a good response in the near future, again consider creating an abbreviated version of the code, one compiles and runs, but that just has a single JButton that swaps images when pressed and none of the other unrelated code.

Luck!

05-15-2011, 02:30 AM

DarrylBurke

Quote:

Originally Posted by Bagzli

thats the whole code

You weren't asked for the whole code. You were asked to post a SSCCE. Did you go through the link?

Setting backgrounds, borders and adding a whole bunch of JLabels are totally irrelevant to the stated problem. Good luck finding someone who's willing to wade through all that irrelevance to sort out your problem.

If you are unwilling to put in the effort to make it as easy as possible for someone to help you, why should a volunteer have to put in extra effort to find what's wrong?

Quote:

Originally Posted by Bagzli

i do not know how to use images that are online. I only know how to use ones that are in the folder.

Are you incapable of going through Fubarable's SSCCE and learning? If so, I doubt you can be helped on a forum.

Quote:

Originally Posted by Bagzli

If you guys can just rename couple images to fit my names it should work for you.

Again, you could have put in some efort to learn by observing, and used the same images used in Fubarable's code.

Help denied on account of laziness.

db

05-15-2011, 03:28 AM

Bagzli

no need to be so mean and offensive about it, thought this would save time, most of the code is just bunch of labels and stuff being added. The problem i am having is in the lines of code from my first post, i posted whole to thing to show theres nothing more to it.

And for the record no i am not incapable, what i posted was quite simple to understand if you were capable of reading my first post and throwing a look at rest of my code you wouldn't be raging at me like a child. I'm removing my code since you find it so offensive...

05-15-2011, 03:33 AM

Fubarable

Quote:

Originally Posted by Bagzli

no need to be so mean and offensive about it, thought this would save time, most of the code is just bunch of labels and stuff being added. The problem i am having is in the lines of code from my first post, i posted whole to thing to show theres nothing more to it.

And for the record no i am not incapable, what i posted was quite simple to understand if you were capable of reading my first post and throwing a look at rest of my code you wouldn't be raging at me like a child. I'm removing my code since you find it so offensive...

Regardless, my recommendation stands: If you're still stuck and without a good response in the near future, again consider creating an abbreviated version of the code, one that compiles and runs, but that just has a single JButton that swaps images when pressed and none of the other unrelated code.

05-15-2011, 03:34 AM

Bagzli

thanks I'll give it a try later today, I'm kind of pressed on time at the moment.

05-15-2011, 03:36 AM

Fubarable

Quote:

Originally Posted by Bagzli

thanks I'll give it a try later today, I'm kind of pressed on time at the moment.

I certainly know the feeling!

Note that your problem could be due to not reading in the image correctly, perhaps due to looking in the wrong place for the images. Do any images show? Do you see any exceptions when you run your program? Also, it's kind of strange reading in an image as an ImageIcon only to extract the Image and then only to use it in an ImageIcon.

Luck!

05-15-2011, 10:48 PM

Bagzli

found a solution on my own, I wasn't aware of .setDisabledIcon function before, using that i managed to make it work perfectly. You may close the thread.