URL and applet

How can i open an url with applet and view the data it has?
thank you for help

/*    <applet code="AppletRead" width="400" height="300"></applet>
*    use >appletviewer AppletRead.java
import java.awt.*;
import java.io.*;
import java.net.*;
import javax.swing.*;
public class AppletRead extends JApplet {
  static boolean isApplet = true;
  public void init() {
    String file = "AppletRead.java";
    String address;
    if(isApplet)
      address = getCodeBase() + file;
    else
      address = "file:" +
                 System.getProperty("user.dir") +
                 System.getProperty("file.separator") +
                 file;
    JEditorPane editorPane = new JEditorPane();
    try {
      URL url = new URL(address);                  // either of these two
//      URL url = getClass().getResource(file);    // methods works okay
      System.out.println("url = " + url);
      editorPane.setPage(url);
    catch(MalformedURLException murle) {
      System.out.println(murle.getMessage());
    catch(IOException ioe) {
      System.out.println(ioe.getMessage());
    getContentPane().add(new JScrollPane(editorPane));
  public static void main(String[] args) {
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JApplet applet = new AppletRead();
    f.getContentPane().add(applet);
    f.setSize(400,300);
    f.setLocation(300,400);
    isApplet = false;
    applet.init();
    applet.start();
    f.setVisible(true);
}

Similar Messages

  • Decompile applet and proxify all URL and socket connection and recompile

    Hi,
    Please anybody have idea for the below.
    I need to decomple the applet class file to .java file and need to change all URL and Socket connection to proxify all connections from applet. and recompile the sample applet to make ready to load in browser.
    Thi is to load the applet form the web server through one proxy server. In the proxy server side While loading the applet from web server that applet code need to be changed to modify the URL and connections used in that applet to change the further connection from applet through proxyserver.
    Compile and decompile is not a problem that i can use javac and javap respectively.
    But I want to know how to change all URL and connection in applet. is there any easy way to handle this with out changing the applet code.
    can Anybody help me.
    Thanks and Regards,
    Shiban.

    Not sure how you do that:
    Client <----[HTTPS]-----> Secure Gateway <------[HTTP]------->Web servers
    or
    Internet Explorer/Mozilla <----[HTTPS]-----> proxy <------[HTTP]-------> Google
    Is the above correct?
    If so than what are the proxy settings in IE/Moz, I can specify the proxy address in the
    browsers but not the proxy type (SSL).
    When you want to visit a page like google I gues you just type http://www.google.com in
    the browsers address bar. The browser will figure out how to connect to the proxy.
    Java has got the control panel in the general tabl there is a button "network settings...:"
    I have it to "use browser settings" and this works for me.
    All URL and URLConnections work but the sockets don't (maybe put in a bug report)
    for example games.yahoo.com -> card games -> bridge -> create table
    In the trace I can see:
    network: Connecting http://yog70.games.scd.yahoo.com/yog/y/b/us-t1.ldict with proxy=HTTP @ myproxy/00.00.00.00:80
    network: Connecting socket://yog70.games.scd.yahoo.com:11999 with proxy=DIRECT
    The second one fails because port 11999 is not open (what idiot uses an unassigned
    port for a profesional site is beyond me).
    http://www.iana.org/assignments/port-numbers
    #               11968-11999 Unassiged
    Even if the port was open on the proxy you'll notice with proxy=DIRECT that
    "use browser settings" does not work with socket (bug report??).
    Anyway my advice is to open the java console (windows control panel or javacpl.exe in
    the bin dir of java.home) and make sure it is set to "use browser settings"
    Then enable a full trace:
    To turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    for 1.5:
    deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    Print out the full trace of the exception:
    try{...}catch(Exception e){e.printStackTrace();}
    Then visit the games.yahoo and try to create a new table playing bridge.
    Inspect the trace and see if it works/why it doesn't work.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem with Image I/O and applet

    I am having trouble using Image I/O to load a PNG image in an applet. I am just using a very basic applet that simply loads the image from a URL and that's it, and the exception I get is -
    java.lang.SecurityException: Unable to create temporary file
    at java.io.File.checkAndCreate(File.java:1294)
    at java.io.File.createTempFile(File.java:1385)
    The simple applet is as follows -
    import java.awt.image.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import javax.imageio.ImageIO;
    public class CheckImageApplet extends JApplet
    public BufferedImage bi = null;
    public void init()
    URL url = null;
    BufferedImage bi = null;
    try
    url = new URL( "http://localhost/CheckImageSystem/checkimages/backGS.png" );
    catch ( MalformedURLException mfue )
    try
    bi = ImageIO.read( url );
    catch ( IOException ioe )
    Any thoughts on this exception would be appreciated

    It seems the line
    bi = ImageIO.read( url );
    fails. Can't see anything else. Perhaps this method needs to create a temp image for some reason, and tries to do this at the local harddrive (not allowed). Use getImage(URL, String); instead. ImageIO isn't intended for applets, I think, so you should use the applet methods.
    Nille

  • Read file from URL and save to FTP

    Hi,
    I have worked in java few years back, now I am out of touch. My friend asked me to create an applet program for him which he can use to download a file from remote location to his ftp server.
    For e.g.
    File
    http://www.demo.com/filename.avi
    Saved to
    ftp://username:password@ftpsite_address/foldername
    I was searching for the classes which I can use to achieve this functionality.
    To save to FTP
    URL url = new URL("ftp://username:[email protected]/folder/filename");
    URLConnection urlconnection = url.openConnection();
    long l = urlconnection.getContentLength();
    OutputStream outputstream = null;
    outputstream = urlconnection.getOutputStream();Using the above code I can get the outputstream to which I can write.
    I am now stuck here, have some doubts.
    What all classes should I use to read a file like
    http://www.demo.com/filename.avi
    I know I can use URL to open connection to URLS and then streams to read the url.
    I am interested in knowing the class which I should use to read any type of file. File can be zip/avi/rar or anything else.
    What all method of the class should I use to read the file which will support all type of files.
    Which classes should I use to write the files. The files are going to be huge in terms of size.
    I have searched everywhere but every place different classes are used.
    Any help is appreciated.

    Ok now I have started coding but facing a problem.
    [PHP]try {
         URL url = new URL("http://url_to_file/test.txt");
         URLConnection urlconnection = url.openConnection();
         long l = urlconnection.getContentLength();
         fTextArea.append("Content Length = " + l);
         BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
         String line;
         while ((line = in.readLine()) != null)
              fTextArea.append("\n"+line);
         in.close();
    } catch (Exception e) {
    fTextArea.append(e);
    return;
    [PHP]
    When I run this code locally it works fine but when run in browser it shows security exception
    java.security.AccessControlException: access denied (java.net.SocketPermission site:80 connect,resolve)
    What should I do to resolve this error. Sorry for being such a noob but do not have much info about this.

  • HttpURLConnection and Applet

    I have created an applet and compiled like this because IE was showing ClassNotFoundException
    javac -target 1.1 URLValidatorApplet.java
    now the the browser is displaying applet but it is not working it hangs when the code reaches to connect to my servlet
    http://www.puneetind.com/URLValidator.html is the url for my applet
    and it trys to connect http://www.puneetind.com:8080/servlet/URLValidatorServlet
    but it hangs
    you can try the above urls and see my applet

    just take a look at you java console window, and you will se the exception.
    juergen

  • Can't display a URL web applet in Double Column

    I've created a URL web applet which displays in the Opportunities homepage. The problem is that the web applet do not displays in double Column, it is only displayed in single column, therefore I only see the half of the applet.
    When I go to Administration/ Application Customization / Opportunities / Web Applets... and change from Single Column to Double and save, it still appears in single column. If I go back to edit the web applet it says : Single column. I don't get it, everytime I change from single to double, CRM OD does not save the changes.
    Does anyone knows a solution?

    hi,
    i have the same problem. Did you solve it?. Please let me know...
    regards,
    MC

  • URL in applets

    Im creating a client - server program with the client being an applet.
    On the server the applet class files are in, say c:/webServer/applet . Now I want to access pictures in, for example c:/webServer/images . So they are on the host computer but not in the codebase directory. Ive tried a few things but Im not that used to working with URLs and especially not on applets where there are security restrictions as well.
    Appriciate any help or tips.

    Can someone please type the code(it shouldnt be more than one line).
    Ive tried
    ImageIcon(new URL(dealer.MyApplet.getCodeBase(), "../" + path), description);
    but that just gives an exception.
    this one works
    java.net.URL imgURL = MyApplet.class.getResource(path); (then putting it in an ImageIcon constructor)
    but I dont know how or if I can get to the folder I want with that one.
    Would realy appreciate an answer since I need it soon and don't have time to search(got ALOT to do at the moment).

  • How to open an URL and close the URL window, using adobe javascript

    Hi,
      Is it possible to open an URL and close the URL back again(without allowing the user to perform any other operation)? I was able to acheive the opening of the URL, using the app.launchURL("address". true); - But here it lauches in new window, and how do i close the window using the javascript. Is it possible?
    Thanks.

    Hi all
    In addition to what Bobby W - Adobe TS added, you might find
    the following useful as a bypass or workaround to the pesky prompt.
    var pw=window.parent;pw.opener=window.self;window.open("
    http://www.adobe.com");
    pw.close();
    I think this will only work for IE browsers. Actually, I
    think the whole window.close() only works for IE, but could be
    wrong about that.
    Cheers... Rick

  • Is there a way to select MULTIPLE tabs and then copy ALL of the the URLs and titles/or URLs+titles+HTML links? This can be done with the Multiple Tab Handler add on; However, I prefer to use a Firefox feature rather than download an add on. Thanks.

    Currently, I can copy ONE tab's url and nothing else (not its name). Or I can bookmark all tabs that are open. However, I'd like to have the ability to select multiple tabs and then copy ALL of the the URLs AND their titles/or copy ALL of the URLs+titles+HTML links? This can be done with the Multiple Tab Handler add on; when I download the add on, I get a message saying that using the add on will disable Firefox's tab features. I prefer to use Firefox features rather than download and use an add on. Is there a way to do this without an add on?

    Hi LRagsdale517,
    You should definitely be able to upload multiple files by Shift-clicking or Ctrl-clicking the files you want to upload. Just to make sure you don't have an old version of the service cached, please clear the browser cache and then log in to https://cloud.acrobat.com/files. After clicking the File Upload icon in the upper-right corner, you should be able so select multiple files for upload.
    Please let us know how it goes.
    Best,
    Sara

  • How can I read the bootstrap files and extract the fragment-URLs and fragment-numbers in plain text?

    How can I read the bootstrap files of any HDS Live stream and extract the fragment-URLs and fragment-numbers in plain text?
    Could it be that it is some kind of compressed format in the bootstrap? Can I uncompress it wirh  f4fpackager.exe? Could not find any download for f4fpackager.exe. I would prefere less code to do so. Is there something in Java of JavaScript, that can extract the fragment-numbers?
    Thank you!

    Doesn't sound too hard to me. Your class User (the convention says to capitalize class names) will have an ArrayList or Vector in it to represent the queue, and a method to store a Packet object into the List. An array or ArrayList or Vector will hold the 10 user objects. You will find the right user object from packet.user_id and call the method.
    Please try to write some code yourself. You won't learn anything from having someone else write it for you. Look at sample code using ArrayList and Vector, there's plenty out there. Post in the forum again if your code turns out not to behave.

  • I want to create an external video widget with iAd. I followed the steps and copied the Url and paste it in the Video pop-up menu in the Properties section of the inspector. When i select 'preview' the video doesn't play and the Url that i pasted is gone.

    i want to create an external video widget with iAd to use in an iBook. I followed the steps and copied the Url and paste it in the Video pop-up menu in the Properties section of the inspector. When i select 'preview' the video doesn't play and the Url that i pasted is gone.
    hope someone can help!

    May have something to do with whether or not the URL can be reached while building your widget.  I've got a video on the web. When I enter the URL into the field for the video object and click to another field,  the URL is replaced with some text indicating that it is accessing the video then updates itself to displaying just the name of the video file.
    It shows just fine in preview and I can see the full path to the video when I export the widget so it should work for you. 
    Is the video accessible from your Mac while you're laying out your widget?
    -Mark

  • How do I get connected to a server on my network via an IP address?  When I try to open in a URL and login as a registered user with proper login it errors out saying there was a problem with connecting to the server?

    I am new to Mac...How do I get connected to a server on my network via a hyper link IP address path?  When I try to open in a URL and login as a registered user with proper login it errors out saying there was a problem with connecting to the server?

    Some of the following is going to use some technical terms — this area is inherently somewhat technical. 
    If you don't understand some part of the following reply, please ask.
    Is this your own OS X Server system on your own network, or is this some other server within some larger organization? 
    You're posting this in the OS X Server forum, which is a software package that allows OS X systems to provide web-based and many other services; to become servers.
    If it's your OS X Server on your network, then the network and DNS configurations are suspect, or the server is somehow malfunctioning or misconfigured.   This is unfortunately fairly common, as some folks do try to avoid setting up DNS services.
    If it's a larger organization and somebody else is managing the server and the network, then you'll probably need to contact the IT folks for assistance; to learn the network setup and DNS requirements, and if there's a problem with the server itself.
    The basic web URL "hyper link IP address path" — without using DNS — usually looks something the following, where you'll need to replace 10.20.30.40 with the IP address of your server:
    http://10.20.30.40
    UptimeJeff has posted a URL that specifies the AFP file system; an OS X file share.  That's used if you're connecting to an Apple storage service somewhere on your network.  You might alternatively need to specify smb://10.20.30.40 or such, if it's a Windows file server.  (There can be additional requirements for connecting to Windows Server systems, too.)
    If there's local IT staff available here, please contact them for assistance.  If these are your own local systems and your own local OS X Server system, then some information on the server will be needed.  (If you're on a NAT'd network, you'll also need to get DNS services configured and working on your local OS X Server system and your network — you'll not be able to skip this step and reference ISP DNS servers here — or things can and usually will get weird.)

  • "Unable to find report specified by URL,Please verify that both Server URL and Report URL are correct". Performance Point Dashboard Designer (SP 2013), SSRS 2012 Report.

    Hello Everybody,
    I am using Sharepoint server 2013 , SQL Server 2012 SP1, PerfomancePoint and Reporting Services in SharePoint integrated mode.
    I built one report in SSDTusing an Analysis Services Cube. This report has 3 parameters. So the idea is use Dashboard Designer to use this SSRS Report and connect it with some PP Filters.
    The issue is that I am always obtaining "Unable to find report specified by URL,Please verify that both Server URL and Report URL are correct".
    I have the following settings in the PP Report:
    Server Mode: SharePoint Integrated
    SharePoint Site: http://MySharrepointSite:PortNumber/sites/bicenter
    Document library : Documents (selected from drop down, my report is deployed to document library)
    Report : report.rdl
    When I select the report from drop down list its giving the error in a pop up message box as "Unable
    to find report specified by URL,Please verify that both Server URL and Report URL are correct".
    I have tried to use the most simple report, only with one parameter, but is always displaying the error above.
    When I open the report directly from documents library its working fine and even it is working fine (
    when I deployed the report) but the issue is parameters are not showing.
    Any idea? Please help.
    Thanks in Advance.

    "Unable to connect to the server at CALYSTO\ReportService.
    Hello Tom,
    It should be "ReportServer" in the URL, not "ReportService".
    In "Reporting Service Configuration Manager" look up the correct URL. Open Internet Explorer with right-mouse click => "Run as Administrator" and open the URL, this should work. Navigate to "Side setting" (on top right side),
    go to tab "Security" and add your account with role "System Administrator". Afterwards you should be able to open the URL without running IE as admin.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Why are url and email addresses not fully viewable in a PDF when generated from a Word file?

    I have a question?
    A colleague in our Copenhagen office wanted to generate a pdf from a Word file.  She is working on a Windows 2007 operating system and is running Acrobat Pro 9.  When she generated the PDF only part of a url and an email address was visible when the PDF was viewed.  She was wofking from Standard settings.  I am running the same software on the same Windows platform and using the same computer equipment with the same settings yet I was able to generate a PDF where the full url and email address was visible.
    Can anyone out in Adobe Acrobat land provide me with an answer?
    Patrick Lennon

    That's probably because the Mac people are opening or viewing the PDFs within the Mac's "Mail" program or with the "Preview" program and not with Acrobat.
    Since the Windows people aren't using these programs and most likely just Acrobat or Adobe Reader, the layers are kept hidden.
    I'm afraid the only way to truly keep those layers hidden is to delete them before saving your file as a PDF. (Of course, do a "Save As" and keep your original .ai file intact.

  • How to add URLs and/or bookmarks to a new toolbar

    I can create a new toolbar and drag buttons from/to the 'Customize Toolbar' dialog, and that new toolbar will be visible.
    But I want to use that new toolbar for extra favorite URLs and/or bookmarks. That does not seem to be allowed.
    I _can_ drag the 'Bookmark toolbar items' icon from the Bookmarks toolbar, but that does not solve my problem, now does it?

    There is one "Bookmarks Toolbar Items" container available for storing bookmarks, and that is where bookmarks are placed if you want them on a Toolbar. I have never seen an add-on that changes that by adding a 2nd "Bookmarks Toolbar Items" container.
    I understand that you want to reduce the toolbar area at the top of the browser window, because I have been doing that for almost as long as I have been using Firefox ''(since 2002 when it was called Phoenix)''. The first thing I do is to get rid of or '''reduce the Menu Bar down to one button''' using one of the various Compact Menu extensions that have been available over the years. This is the one I currently use.<br />
    https://addons.mozilla.org/en-US/firefox/addon/compact-menu-2/ <br />
    This extension hides the Menu Bar and places a button on the left side of the Navigation Bar upon installation. Click that blue globe button or hit the '''''Alt''''' key and the the Menubar Items appear in a drop-down menu. You can even drag that small button into the [https://support.mozilla.com/en-US/kb/How+to+customize+the+toolbar Customize Palette] and use the '''''Alt''''' key to open the Menubar Items drop-down. <br />Hidden from view, but easily accessible when you need to use a Menubar Item.

Maybe you are looking for

  • Mac mini with a G3 moniter?

    I have a G3 labtop and i have decided that it is just not fast enough. So i am wondering if a mac mini will run on the moniter of my labtop.

  • Where is the SE Aino Support located now?

    Hi Just out of curiosity, I was wondering where the Sony Ericsson Aino Forums are located now, I understand that the actual SE Aino Section was deleted but where would I post for assistance if I do encounter a problem on my aino? Also, a suggestion,

  • How to create ios environment with adobe id?

    Hi , i am trying to create ios environment in windows platform. can any one please tell me, how to create IOS environment with adobe id. I a created adobe id and inserted code into it. But its running (Since one hour), and no response. Any one have i

  • Issue with building an array from a cfhttp request result.

    Here is what I am trying to do. Retrieve a bunch of results from a  REST request. Run a query to see if I should be excluding any of the xmltext entries coming back from the rest request. Build an array of the REST xmltext entries except the entries

  • Update hidden column using Apply MRU

    I want to update username which is a hidden column with an value when I submit update using ApplyMRU. How can I do it? Apex 4.1, Browser IE/FireFox, Using Form Tabular with ApplyMRU.