Joptionpane showmessagedialog icon

By: golden_n6 On: 01.07.2017

So I have a pop-up dialog in my application that tells the user about the program.

joptionpane showmessagedialog icon

Everything was going fine until the custom icon. Here's what I've attempted:. I know this is a little old, but as there was no reply that solved my question, after some research this is what worked for me working with java 1. It seems to me as a good practice to create a 'resources' folder in your project, and inside it a 'icons' folder, and to refer to that location every-time you need an icon or anything else such as audio files, images etc.

Here this may help: The same thing happened to me, thank God I looked that my image was loaded not in the 'source' file, it was in 'bin' file.. You just have to place the preferred image in your project's folder and your image will show up in the project navigation tab , after that just copy the image path and paste it into:.

By posting your answer, you agree to the privacy policy and terms of service. Stack Overflow Questions Developer Jobs Documentation beta Tags Users. Sign up or log in to customize your list. Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us.

Log In Sign Up.

Error (Forbidden)

Join the Stack Overflow Community. Stack Overflow is a community of 7. Join them; it only takes a minute: Here's what I've attempted: Screaming at java Attempt 5: Using URL's All have had no affect on the program and instead of an image, I don't get anything.

java - Icons on JOptionPane - Stack Overflow

I'm not so sure about. Yeah, you're not looking in the right place. Do you know for a fact where your user directory is?

Also, is this in a jar file or an applet? The command you gave me returns null. This worked for me: John Kurlak 4, 3 26 Doesn't work for me: You are correct, sir. The second source using an URL works for me.

I am pretty sure the paths are failing because the current directory is not where the OP thinks it is. Several here including me have been trying to say that to him for a while, but he won't believe us.

That's why I'm trying to get him to see where his user directory is, but he seems to be ignoring that comment of mine. This is getting frustrating. I have used the getClass.

joptionpane showmessagedialog icon

Hagai 5 It's not that I can't do that; I'm trying to use the built in function of JOptionPane to display an icon. This is assuming the icon is in the working directory of the java process.

Everyone was right it's just that the path copied is incorrect. You just have to place the preferred image in your project's folder and your image will show up in the project navigation tab , after that just copy the image path and paste it into: Sign up or log in StackExchange. Sign up using Facebook.

JOptionPane showMessageDialog examples (part 2) | jyfyyuxy.web.fc2.com

Sign up using Email and Password. Post as a guest Name. Stack Overflow works best with JavaScript enabled. MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.

Rating 4,9 stars - 333 reviews
inserted by FC2 system