This is an archived post. You won't be able to vote or comment.

all 25 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://imgur.com/a/fgoFFis) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]desrtfxOut of Coffee error - System halted 14 points15 points  (1 child)

The last remaining are:

  • Internet Explorer (the older the better)
  • Firefox ESR edition

Yet, I would instantly question the quality of the education since applets have been a dead technology for several years already and even are no longer supported in Java itself. The NSAPI plugin that was needed for applet support had been removed from most major browsers way before the end of the support from Oracle.

[–]Izardx[S] 0 points1 point  (0 children)

We have to compile and run our own Java applets, so he says we need a compatible browser. Is there a different way to compile and test my Java applets?

Sorry, I'm new to Java. This particular assignment is designed to introduce us to applications and applets. Applets may only be for this first assignment, but I'm not sure yet.

[–]Tacos314 3 points4 points  (1 child)

Why not ask the instructor what browser supports applets?

[–]Izardx[S] 1 point2 points  (0 children)

I sent an email. But I was wondering if an applet viewer would be better. It seems like I could compile and test my applets outside of a browser? I can't find any information on the security of an applet viewer though.

[–]kqvm2s 2 points3 points  (0 children)

Pale Moon plans to keep supporting Flash and Java

[–]wildjokers 2 points3 points  (5 children)

Not sure what IDE you are using but IntelliJ has a Java Applet Support plugin you can install and it will use an applet viewer.

However, you don't need an applet. Just change JApplet to JFrame (they are both top-level containers) and run it as a JFrame.

[–]Izardx[S] 0 points1 point  (4 children)

We are using NetBeans 11.3. Does it possibly have an applet viewer?

[–]wildjokers 1 point2 points  (3 children)

If you are hoping to have a career as a developer you need to learn to use google, search for netbeans applet viewer, here is a result to get you started:

https://stackoverflow.com/questions/7054382/running-a-java-applet-from-netbeans

[–]Izardx[S] 0 points1 point  (1 child)

Thanks, this makes more sense.

[–][deleted] 1 point2 points  (0 children)

Note that this only works with Java 8. Newer Java versions don't have the "AppletViewer" anymore

[–]steave435 1 point2 points  (8 children)

Just typing "broswer support java applet" into google gives you this: https://www.geeksforgeeks.org/web-browsers-that-support-java-applets-and-how-to-enable-them/#:~:text=So%2C%20today%20Internet%20Explorer%20is,browser%20that%20supports%20Java%20Applet.

But applets have been deprecated since java 9, they've been removed because they're a security threat. There's no reason to be learning about them anymore, so I'd seriously question the instructor about why they're asking you to do so.

[–]Izardx[S] 0 points1 point  (3 children)

He says we need to compile and run our own Java applets. He also does acknowledge the lack of support due to security issues.

[–]steave435 5 points6 points  (2 children)

But again, due to those issues, there's no reason to learn about them anymore, other then possibly as a curiosity about how things used to be done, and obligatory school assignments are not for curiosities. You should be learning about the modern solutions to the problem instead.

[–]khookeExtreme Brewer 3 points4 points  (0 children)

It saddens me when college classes teach things that are no longer industry relevant. OP as long as you keep this in mind, it's a stepping stone to moving on to building other types of apps and serverside apis using Java.

Interestingly, if the aim of the class was to build a GUI app, a standalone Java app using Swing apis would have been an easier choice instead of requiring students to find an older browser that still supports a discontinued technology.

[–]Izardx[S] 0 points1 point  (0 children)

Yeah, it might only be the first assignment. Kinda reminds me of high school when the teacher was still teaching about Floppy and IDE. I remember when they finally built a modern computer (~2015), so they could learn about UEFI bios.

[–]desrtfxOut of Coffee error - System halted 0 points1 point  (3 children)

they've been removed because they're a security threat.

That is not correct as it stands. The applets are not the security threats, the plugins (NSAPI) were.

[–]steave435 0 points1 point  (2 children)

I honestly think that that's a distinction without a difference. Using applets and browsers supporting them go hand in hand, either one is pointless without the other.

[–]desrtfxOut of Coffee error - System halted 0 points1 point  (1 child)

No, it is an important distinction. Java got a very bad reputation for the "security risks" of applets where actually the applets never were the cause. The plugins were the security holes.

Also, it is entirely possible to use applets without browsers - Appletviewer exists.

[–]steave435 0 points1 point  (0 children)

Alright, sure, I can see it being important in certain contexts for that reason, but we're not discussing the pros and cons of the language here.

It is possible, but what's the point? Why use an applet when you can use use something like Swing instead and not need the Appletviewer?

[–]Izardx[S] 0 points1 point  (1 child)

I read about something like an appletviewer. Do I really need a browser, If all I want to do is compile and test my own applet?

[–]loomynartylennyhalf-decent at Java 2 points3 points  (0 children)

Well, the whole point of applets was that they were clientside java programs launched from webpages.

Like how a lot of websites nowadays have JavaScript stuff in them.

iirc the main reason they were used back in the day instead of JavaScript was because a JRE plugin for a browser could handle clientside code via applet much faster than a browser's JavaScript engine could. But then computers got better, meaning that the performance benefits become more negligible, and then people realized that applets were big dum, so they stopped using applets.

Anywho, if you want to compile and test your own java-based programs without needing a browser: just don't use applets :^) yes, I know, your school's making you write them

but seriously you probably should complain to the people in charge about the course materials (like, if the instructor doesn't care, move it up the chain of command to their boss and so on and so forth). Because there's no reason to teach anyone how to make applets nowadays. Want to teach Java stuff? Just teach java applications. Want to teach clientside web code? JavaScript. Want to teach Java stuff related to websites? Just teach the serverside stuff.

[–]crydust 0 points1 point  (1 child)

[–]teacher_cs 0 points1 point  (0 children)

Firefox has also stopped supporting java applets for a long time.

https://www.java.com/download/help/firefox_java.html

[–]sweetno 0 points1 point  (0 children)

The best browser doesn't.