Opening a browser from an applet

I got a problem, I want to open a browser from my applet, but I just found one way:
getAppletContext().showDocument(new URL(
"http://www.java.sun.com"), "_blank");
but the problem is: with this, the default browser with defaul settings is opened, and that's what I don't want...
how can I open the browser with some settings (for example size, or no-url-bar, etc)
thx for help

hi,
try this code:
public void showDocument(java.net.URL url, String targetWindow)
when targetWindow can be:
"_blank" Display the document in a new, nameless window.
"windowName" Display the document in a window named windowName. This window is created if necessary.
"_self" Display the document in the window and frame that contain the applet.
"_parent" Display the document in the applet's window but in the parent frame of the applet's frame. If the applet frame has no parent frame, this acts the same as "_self".
"_top" Display the document in the applet's window but in the top-level frame. If the applet's frame is the top-level frame, this acts the same as "_self".

Similar Messages

  • How to close the browser from an Applet?

    Hi,
    I've written one applet, with 2 buttons (Continue & Exit). On click of Continue button, it will open another web page. On click of Exit button, the browser should be closed.
    I'm not able to close the browser from the applet.
    Can any body help me.
    Rgds
    Santosh

    In my experience, calling Javascript from applets is flaky at best. However, I have gotten it to work in some cases. The following code should get you started:
    netscape.javascript.JSObject win = netscape.javascript.JSObject.getWindow(applet);
    Now you can call different methods on the win object (look into Javascript documentation for details).
    It also depends on if you are using the Java Plug-in or the JVM built into the web browser. You probably need set MAYSCRIPT=TRUE in your HTML. Look into the Java Plug-in documentation for details...

  • How do I save and import my bookmarks from another hard drive? When I try to open the installed Firefox on the old drive, it (obviously) opens a browser from the new main drive, free of bookmarks. Is there a way I can save the bookmarks on the old drive w

    How do I save and import my bookmarks from another hard drive? When I try to open the installed Firefox on the old drive, it (obviously) opens a browser from the new main drive, free of bookmarks. Is there a way I can save the bookmarks on the old drive without opening a browser?
    The guts of my computer were rearranged and I got a new main hard drive. My old one is still in there and I can get stuff from it, but when I go to the Mozilla folder on the old one, I can't figure out if there's anything I can do to get all my bookmarks from that drive to my new one, where Firefox is newly installed.

    If you open Firefox then Firefox will always use the default profile folder as found via profiles.ini on your system drive.
    You either need to import the file in your current default profile or copy the file to your current profile folder while Firefox is closed.
    Firefox 3 stores the bookmarks and the browser history in [http://kb.mozillazine.org/places.sqlite places.sqlite] and no longer creates an HTML backup by default.
    There are also (five) JSON backups in the bookmarkbackups folder within the Firefox profile folder.
    You can either copy the file places.sqlite to your [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder] or import the most recent JSON backup from the bookmarkbackups folder of that old profile.
    See:
    http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox
    http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    See http://kb.mozillazine.org/Profile_folder_-_Firefox
    "Application Data" in XP/Win2K and "AppData" in Vista/Windows 7 are hidden folders.
    See http://kb.mozillazine.org/Show_hidden_files_and_folders
    Go to: Control Panel > Folder Options > "View" tab > under "Hidden files and folders", select "Show hidden files and folders".
    You may want to un-check the box "Hide extensions for known file types" to see the file extensions of all files.

  • Opening a socket from an applet

    I tried to open a socket from an applet to a server on a remote computer and I've got a refusal message.
    When I try it on a server in the local machine, it works.
    What could be the problem ?
    P.S. : when I open the socket from an application in the Java environment, to the same remote server it works ok.

    this is part of the security system built into java and Applets
    unless you sign an Applet it cannot do many "dangerous" things, like..
    access the loacl file system
    connect to any server except the server that it came from

  • [NEWBIE] How to open a frame from an Applet?

    Hi, I'm trying to open a JFrame from an Applet. Basically, I would like that, once the user selects an option from a JMenu, a Frame would be shown with a text box where user could type some content.
    I built both the Applet and the Frame, and singularly they work. When I execute the main method from the JFrame, the window appears, but when I execute something like the following from the applet:
    MyFrame mf = new MyFrame();
    mf.setVisible(true);nothing is shown. I'm sure that I don't know something, but I just started with applets.
    Thanks for any help,
    Marco

    If MyFrame is a subclass of JFrame, then it should not
    make any difference.
    What do you need the JFrame for? Can this be done
    using another "screen" by using a CardLayout?From a menu, when the user selects 'Start game' I need a text box coming out so that the user can insert a word. This word should then evaluate an instance member of the Applet.
    Marco

  • Closing Web Browser from an Applet

    Does anyone knows how to close the Web Browser from an Applet ?
    Also Is there a way to close a browser which is intantiated from using ApplteContext ().showDocument ("....","_Blank").
    Thanks
    Sohan

    Hi kavinjir!
    Using class netscape.javascript.JSObject is possible to interact with javascript which can easily close the window browser but I'm afraid about the newest one because it isn't a child window. If this newest window contains an applet both (applets) can interact and send/receive "messages" to trigger an event (e.g; close via javascript again).
    Best Regards.

  • Browser enabled InfoPath form not opening in browser from a link in a Task list

    I have a browser enabled InfoPath deployed to SharePoint as a template in a Forms Library. The form opens in the browser when a user navigates to the Form library and clicks New.
    There is an Approval workflow associated with this form which kicks in whenever a new Form is submitted. The workflow creates a task in a task list. The task list shows a Link column which provides the link to open the form. Now, when a user clicks on the
    link (in the Task list), the form always open in InfoPath instead of opening in a browser.
    I see that the URL for the form (http://<Server>/Training/Enrollment%20Forms/<FormName>.xml)  is same in both the Forms Library and Task list link.
    What am I doing wrong or what do I need to do to make the form open in browser from the Task list link.
    Thanks
    Rajat

    This question is asked constantly - we just discussed this last week, I believe - so you can probably find a lot more discussion to help you out if yous earch within this form or browse through the topics.  The reason for your issue is because of
    what you just wrote - the URL is directly to the XML file, so it tries to invoke InfoPath.  Browser forms are rendered by Forms Services, which has a much different URL.  Go click on one of your existing forms, and notice how different the URL is. 
    To get forms to open in the browser when invoked from a different location, you must use this full Forms Services URL.  Built-in workflows only generate a link to the XML file, and since the task in a different list than the form, then it has no idea
    how to open the form in the browser.  Only users who don't have InfoPath installed will see it in the browser automatically.  This is why I generate my own URLs dynamically with custom workflows and don't use OOTB workflows.SharePoint Architect || Microsoft MVP ||
    My Blog

  • Open a browser from swing panel

    How can we open a browser from a swing panel? I want to open a browser from my panel, when i hit on a button or a link?
    Second question how can i create a link in a panel?
    Thanks

    odd, someone just asked that:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=555001&tstart=0&trange=15

  • Why does it take 3 goes to open my browser from my desk top?

    It takes me 3 attempts to open my browser from my desktop icon. 3 lots of double clicks before Firefox will open. Things changed about a week ago. All was well before then. What has happened?

    I would have thought if you select a program to come to the forefront it is
    "active"and ready to use?  Is this an issue or am I doing something wrong? 
    Thanks
    Tried this on my setting but after having clicked on the icon the Bridge
    window is present, ready and active. No need for an click here.
    Have you already tried system maintenance for OS using Apple Disk utility to
    check and repair permissions?

  • Can i open a page in Browser from an applet

    i want to open a web site in a new browser window from an applet.
    Is it possible. if posible then send me some links or codes
    thank you

    Do you know how to use applet to link to another webpage? set the target = _blank
    public class App extends Applet {
    getAppletContext().showDocument(new URL("http://java.sun.com"),"_blank");
    }

  • Open a Specific browser from an applet

    We can open a browser using appletContext().showDocument() Or even using Runtime.getRuntime().exec(rundll32,url.dll,FileProtocolHandler),
    but how can i specify a specific browser in applet. I have an application which works only in IE.

    You can't open a specific browser (if the applet is unsigned), and what's the problem with showDocument()?
    The need for this is unclear to me.

  • Opening a frame from an applet

    Hi,
    I want to open a frame in my applet. If I'm using swing, JApplet opening a JFrame, is it possible to keep the frame open if the user browses away from the page that holds the applet?
    Are there any tricks? I've tried opening it in a new Thread, but it still goes away when the the browser's page changes.
    Could I call getParent() from the applet until I get an instance of Frame (which would be the browser) and set my JFrames' parent? Or does that only work with the old Netscape and old AWT Frames?
    I basically want to know if I can keep my JFrame open until the browser is closed. Any ideas or suggestions would be greatly appreciated.
    thank you very much

    Do you want to open a jsp application in a frame when you click on the applet?If so, there is a programme in http://www.globalleafs.com -Java-Java Applets 's download section. Check it out.

  • Opening a browser from javafx webstart.

    I am deploying an application as a web start (.jnlp) application. I was wondering if there is a way to open a browser window when running the application from web start.
    This code snippet is what I currently use (this does not work for web start). This code works as a standard application and as a browser applet.
    How can I get this to work for webstart?
        var browser: Boolean = "{__PROFILE__}" == "browser";
        public function openBrowser( url: String ): Boolean{
            if(not browser){
                var applet = FX.getArgument("javafx.applet") as java.applet.Applet;
                Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler {url}");
               return true;
            else{
               AppletStageExtension.showDocument(url, "_blank");
                return false;
        }

    Control browsers from your Java application

  • 'Browse' from an applet

    Hello again! I have an applet in a JSP which runs on tomcat server. Is there any way to have a button in the applet which opens a 'Browse' dialog, where to select a file (any type) and send it to the server? Or JavaScript is the only solution?
    Mihai

    To do that in the applet, you need to sign the applet. But you can do it with a plain old-fashioned html form.
    Javascript is in no way necessary.
    Whatever way you choose to send the file from the client, you do of course need something on the server to take care of it. If you use a HTML form, and since you have a tomcat server there, the best is to make a servlet using the com.oreilly.servlet package. (Google for it for details.)

  • Can you disable the status bar on a web browser from an applet?

    I have a signed applet and am using plugin 1.3.1_02 with IE 5.5. I use the showStatus("text") method to display pertinent information to the user in the browser's status bar.
    Currently I see all types of messages being displayed (in IE's status bar) as my applet communicates with the server. I would like to restrict what is shown in the status bar to show my system messages only.
    Can I filter what is displayed or disable status bar functionality programmatically from the applet? Or possibly with a browser/plugin setting?
    Thanks

    Hi,
    I think you can do that with Java to JavaScript communication.
    thanks,
    Srinivas.

Maybe you are looking for

  • Sales order quantity & delivery Qty

    Hi In delivery we can increase the materia qty other then sales order qty. For e.g  in sales order qty is 100 pc for material Z but in delivery we can increase the qty 150 pc. Where to make the settings so that sales order qty will be  equal to or le

  • Cannot open project

    I created a film using FCE 4.0.1 last December. I have not done anything to that file or to my software. I have not edited anything since. I am still running Snow Leopard. When I just tried to open the project it was refused saying that either it was

  • Bc4j jsp calendar deployment problem

    Using jdeveloper 9.02 I made a simple webapplication with bc4j jsp's and deployed it to oc4j (9.0.2.1) directly from jdeveloper as described in the help. This works fine, except for the calendar (datepicker). When the calendar is loading in a separat

  • Opening PDF documents in safari

    When I try to open/download a pdf document, I gat a lego brick with a question mark on it. If I want to see the file I have to download it and view separately. This only happens on Safari for Windows, on al other browsers, including Safari for Mac OS

  • Unicode, assignment  char to hex

    Hi Experts,     I have a question related to assignment of char to hex in uni-code system. Here is piece of code: In non-uncode system: data: begin of struct, x1(1) type x, end of struct. data: c1 type c value 'C'. struct1 = c1. In unicode system *st