Ok, so I have images for my applet, but when I upload it online, none of the images appear.

When I add an image, they are all Image Icons for Labels, and I just browse to the folder on my desktop, selected the image, and hit ok. It then shows up on the GUI for Netbeans...so I figured that process implemented the image as part of the package.

If that is not the case, and thus why they do not show up when it is uploaded, how do I fix this, or make the images a permanent part of the program?

Thank you,
-Austin.

Recommended Answers

All 13 Replies

maybe not,

and I just browse to the folder on my desktop, selected the image, and hit ok. It then shows up on the GUI for Netbeans

please look for JFrame instead of JAplet (sure if you don't want to distibute this applications on WEB), otherwise please search for restictions for JApplet f.e. http://download.oracle.com/javase/tutorial/security/tour1/step1.html

There are a few different ways to manage that with relative paths or getResource(). Take a look at this info in the tutorial on using Icons.

So...find a way to put them into the package, then have the ImageIcon point to that instead?

JFrame is better option, again are you planing to distribute JApplet to web, because for JApplet (from java 1.6.20) are changed some important security rules from/to Native OS (sand-boxed, trusted or none with/without combine with JNLP)

yes is possible to place your images into java package(s), there isn't any restrictions for that (I hope that isn't something newssss)

Ok, this is my VERY first applet ever...lots of problems with it lol.
I want the window it opens in to not be expandable, and somehow have firefox allow me to close that window when they hit exit as well.

I shall look into the images thing.

And since I'm new, I dont know this security stuff.


EDIT: Ok, images are working, but I was wondering about this security stuff, and how I can get this to just...appear nicer before I start working on the applet itself. Also, about closing that window when the program ends.


This is a pop-up applet btw, because I want it to be mobile, and not subject to a large window.
http://www.dawnofvengeance.com/applications/

Thanks,
-Austin

Member Avatar for Javam

hm, On security stuff, I am not realy expert on this and is hard to comment. But, On question #2, I believe overriding the destroy method of JApplet will help you.

void destroy()
Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources that it has allocated.

http://download.oracle.com/javase/1.4.2/docs/api/java/applet/Applet.html

hm, On security stuff, I am not realy expert on this and is hard to comment. But, On question #2, I believe overriding the destroy method of JApplet will help you.

void destroy()
Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources that it has allocated.

http://download.oracle.com/javase/1.4.2/docs/api/java/applet/Applet.html

So...destroy() will actually close the browser window that is holding the applet. Yes?

What about keeping the browser at a locked size? So the user cannot resize it.

Thanks so far!
-Austin

I don't think applets cannot do any of those things to the browser.
http://download.oracle.com/javase/tutorial/deployment/applet/security.html

Hmmmm, well, is there a way I can link the "exit" menutime to some sort of php or javascript or something else that will close the window? ]
If it will take a lot of work though, I can just come back to it later.


Also, when either of you go to my applet, do you see the images (should be next to each skill)? It worked at home, maybe my university just blocks those particular images.

Thanks
-Austin

please ...

again you didn't

1/ change JApplet to JFrame
2/ read restrictions and security issues from/to Native OS
3/ sure at home you have (probably) admin (root for nonWin Native OS) access, elsewhere user access, are you surprised
4/ anyway for every options == finally put those images into your Java package(s)
5/ I hard to imagine that we'll start to solve JNLP file for that

A Jframe cannot be posted on a website however, I tried that first. We had to move to an applet because that was the only way it could run off machine.

nice reply, sure my last post had 5 point, all rellated with JApplet, are you done with that, haven't you

hmmm with all those restictions (with today JVM), isn't would be better choise start with JSP (Netbeans has excelent implementations for that, with lots of tutorials) or Ruby on Rails, because Applets is long time dead stinky fish

check this thread, here you get runnable JApplet by one Java Guru (follows link) http://forums.oracle.com/forums/thread.jspa?threadID=2189526&tstart=0

nice reply, sure my last post had 5 point, all rellated with JApplet, are you done with that, haven't you

hmmm with all those restictions (with today JVM), isn't would be better choise start with JSP (Netbeans has excelent implementations for that, with lots of tutorials) or Ruby on Rails, because Applets is long time dead stinky fish

check this thread, here you get runnable JApplet by one Java Guru (follows link) http://forums.oracle.com/forums/thread.jspa?threadID=2189526&tstart=0

I will look at that link, but you kind of lost me with the first two paragraphs. The English was kind of jumbled. sorry, and thanks so far.

-Austin

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.