The usual java project is configured, outputted by Hellow World. Now trying to create an applet

import java.applet.Applet; import java.awt.*; public class Main extends Applet{ public void paint (Graphics g) { g.drawString("Hello, world!",0,50); } } 

This is how I try to output a greeting. In the console it displays errors:

 Exception in thread "main" java.security.AccessControlException: access denied ("java.io.FilePermission" "C:\Temp\AppletPage.html" "read") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) at java.security.AccessController.checkPermission(AccessController.java:884) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkRead(SecurityManager.java:888) at java.io.File.isDirectory(File.java:844) at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:82) at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) at sun.applet.AppletViewer.parse(AppletViewer.java:1121) at sun.applet.AppletViewer.parse(AppletViewer.java:1092) at sun.applet.Main.run(Main.java:156) at sun.applet.Main.main(Main.java:98) at sun.applet.AppletViewer.main(AppletViewer.java:1275) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) 

Actually the question is how to get access?

ide IntelliJ IDEA 2016.2.5

java version "1.8.0_111"

  • I am not an expert, but applets seem to be something like applications in the browser, so it’s logical that you cannot work with the file system, and the technology is outdated - selya
  • In the university, the labs went ... do not tell me how to connect IntelliJ IDEA and Open Server - Ghost
  • I work both with that, and with that, but I do not mess with applets. In theory, if you need to use openserver, then you simply take the project and put it in the domain daddy, then start the openserver and open index.html in that browser in the browser. But it’s hard to advise on something, because I don’t even understand the meaning of the phrase “to tie IntelliJ and OpenServer” - selya
  • Is it possible to configure it so that ide would not refer to the file after compiling, but access the server? - Ghost

0