Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7800521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:39:54+00:00 2026-06-02T00:39:54+00:00

I created this in textpad because our instructor doesn’t want us using IDE’s. I

  • 0

I created this in textpad because our instructor doesn’t want us using IDE’s. I am trying to type a website in and view it in the JEditorPane.

    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    import java.util.*;

    public class ViewRemoteFile extends JApplet
    {
        private JButton jbtView = new JButton("View");
        private JTextField jtfURL = new JTextField(12);
        private JEditorPane jtaFile = new JEditorPane();
        private JLabel jlblStatus = new JLabel();

        public void init()
        {
            JPanel p1 = new JPanel();
            p1.add(new JLabel("URL"), BorderLayout.WEST);
            p1.add(jtfURL, BorderLayout.CENTER);
            p1.add(jbtView, BorderLayout.EAST);
            add(new JScrollPane(jtaFile), BorderLayout.CENTER);
            add(p1, BorderLayout.NORTH);
            add(jlblStatus, BorderLayout.SOUTH);

            jbtView.addActionListener(new ActionListener()
            {
                public void actionPerformed(ActionEvent e)
                {
                    showFile();
                }
            });
        }

        private void showFile()
        {
            //Scanner input = null;
            //URL url = null;

            try
            {
                jtaFile.setPage(new URL(jtfURL.getText().trim()));
                jlblStatus.setText("File loaded successfully");
            }
            catch(MalformedURLException ex)
            {
                jlblStatus.setText("URL " + jtfURL.getText().trim() + " not found.");
            }
            catch(IOException ex)
            {
                jlblStatus.setText(ex.getMessage());
            }
            /*finally
            {
                if(input != null)
                    input.close();
            }*/
        }
    }

When I run this code it doesn’t show the site and it crashes and fills my console with a ton of errors.

for http://www.yahoo.com I get :

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.security.AccessControlException: access denied ("java.net.Socket
Permission" "www.yahoo.com:80" "connect,resolve")
        at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:366)
        at java.security.AccessController.checkPermission(AccessController.java:
555)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        at java.lang.SecurityManager.checkConnect(SecurityManager.java:1051)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:466)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:213)
        at sun.net.www.http.HttpClient.New(HttpClient.java:300)
        at sun.net.www.http.HttpClient.New(HttpClient.java:316)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLC
onnection.java:992)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:928)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:846)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1296)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468
)
        ... 40 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:39:56+00:00Added an answer on June 2, 2026 at 12:39 am

    It is an applet, it needs to be signed to access a socket. An unsigned applet is only allowed to connect to the host it came from. Check out Signed Applets and What Applets Can and Cannot Do

    EDIT: display HTML documents:

    I’m not sure what is your objective, but if you want to display HTML page you may find showDocument useful. Here is an example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created this report using BIRT and phpjavabridge <?php header(Content-type: application/pdf); header(Content-Disposition: inline;
I have created this view in DB2 LUW: CREATE VIEW SCHEMA.TYPE(TYPEID, TYPENAME) AS SELECT
I created this program: #include <iostream> #include <fstream> using namespace std; int main ()
I created this example The remove function doesn't work, and I can't figure out
I've created this basic 3D Demo using OpenGL/SDL. I handled the keyboard callback so
I created this script and I want to print the outputs on one line,
I created this simple textpad program in WPF/VB.NET 2008 that automatically saves the content
I created this page for better understanding the question. As you can see using
I created this fiddle so that you can see what i am trying to
Our designer created this css for links A { text-decoration: underline; color: #E77C15; }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.