Open a html page from an applet
Hi,
I would like to open, from an applet, an HTML page in a new window with a specific width an eight.
Who can help me ?
Here is an example of applet to javascript with liveconnect:
http://www.narhari.com/java/applet2javascript/
You can use the send(String) method from the sample applet to send something like:
window.open('xyz.html','myPopup','width=200,height=200');in order to open a window with specific dimensions
of course you can also build HTML in your applet and use send() + some javascript to render it.
Similar Messages
-
Opening a HTML page from a Navigation link
Hi All,
I have a requirement of adding a new link at the navigation bar of WebClient. This link will open a static html page with some contents. I have created the page required for it. But I don't know how the link will be created at Navigation bar and how to open the html page from it. I am using the SAP CRM 5.0 and I want to add the link at Default profile.
Please help.
Thanks
Indranil DattaHi Sujit,
Thanks for your help. I have created a new navigation bar entity and added that in a customized profile. I have also mentioned the page name and path for that link from tran SPRO. I found that link after logging into IC WebClient. But that link is not connected with the required page. If I click on the link page, it get refreshed but without any change.
Thanks,
Indranil Datta. -
Open an *.html page from a vi
Hi,
I don't know how to open an .html file from a boolean bouton.
someone could help me ?
thankstst wrote:
But the HTML file on the RIO (if it's anything like remote front panels on the PC) is only a "pointer" to the VI. It is only used so that the browser will have a place to start. The PC has nothing actually running on it and the RIO is not displaying the web page.
Here is the basic text from a sample file which tells the web browser to connect to a running VI.
http://www.ni.com/webappdemos/lv">>
You can see that it's only a few lines telling the browser to connect to the VI. I think that to use the link you will either need an LV program running on the computer or you will need to write your own browser for the RIO (not a recommended solution).
Is all right, I know that the html file make only a connection to the VI, but the the web page file are on the cRIO.So I don't understand because you think that the browser must start from the cRIO. If I actually can visualize an html file, that is on the cRIO, and the browser are running on my pc, why a link from the VI (as www.html.it) must open a browser on the cRIO and not on client PC? -
How to call and run HTML pages from an Applet?
I want to run another HTML page when pressed a button in an Applet,how can i do it?
Are you looking for this?
applet.getAppletContext().showDocument("http://cullenwines.com.au", "_top"); -
How to call html page from an applet
I want to call a html page after the user presses a OK button in the applet. please help me in this.
In you actionPerformed put:
AppletContext appContext=getAppletContext();
URL myURL= new URL("http://www.javasoft.com");
String target="_self";
appContext.showDocument(myURL,target);P.S. If you want to pen the URL in a new Browser window
use
target="_blank"; -
Call a html page from a applet
did somebody can tell me how call any html page to display in the current window of the browser when the user push a Button in one applet
http://forum.java.sun.com/thread.jsp?forum=31&thread=566530&start=1&range=1
or
http://forum.java.sun.com/thread.jsp?forum=31&thread=566059&tstart=0&trange=100 -
Open a JSP page from an applet
Hello u all!
I am writing an applet in which I ask for a few parameters,when I have them all I�d like to open a new JSP page in another window of the web browser giving to this page all the parameters I have collected during the life of the applet. Does anybody know how can I do it? Thanks in advance.Hi,
Use the showDocument method in conjunction with getAppletContext.
And pass all ur parameters thru it.
Lushhay -
Opening an Html page from java code
Hi
I have created an application and in order to complete it i need to configure help file with it. Now i have created a menubar in which help button is present.
My requirement is that clicking the help button should display the help file which is in the form of an html file in a new window just as in any other application.
Can anybody help me on this issue? Your help would ge really appreciated :)
ThanksMy requirement is that clicking the help button should display the help file which is in the form of an html file in a new window just as in any other application.Do you want to open a new "Browser"? is this a hard and fast requirement? If not why don't you use javahelp instead.
For more details refer : http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javahelp/index.html -
Problem open new html page from flash
Hello,
in IE7 and IE8 block popup lock my external link(page html)
I use GetUrl(url,"_blank") but not it works
Why?
i use flash cs4
With firefox it workthank you for response,
i have used correct command but not it works.
It Works, in my popup setting are setting "CUSTOM" not MEDIUM
thank you -
How can I display the HTML page from servlet which is called by an applet
How can I display the HTML page from servlet which is called by an
applet using the doPost method. If I print the response i can able to see the html document. How I can display it in the browser.
I am calling my struts action class from the applet. I want to show the response in the same browser.
Code samples will be appreciated.hi
I got one way for this .
call a javascript in showDocument() to submit the form -
How can I open a HTML page by pressing a button on the stage?
I've created a rollover button and I'm trying to make it open
an existing html page from the local disk (not an internet URL).
But I can't make it open with Lingo or behaviour.
Please help.
Thanks a lot.
Gideon.goToNetPage "
http://somewhere.html" is the
typical form for a page on
the web, director must use the address format the system's
browser uses
for local files, this is somewhat platform dependant, a
practical
aproach is to open the file in question from within your
browser then
copy and paste the displayed address into your lingo code.
Some report the goToNetPage counterpart provided by the
buddyAPI xtra
works more reliably, the xtra can be used for free if limited
to a
couple of functions.
An alternate approach buddyAPI can use is to have the browser
directly
access the html file as if it were double clicked in the file
manager
using the same form commonly used to open PDF files with
acrobat.
(sorry I don't have example code handy) -
Opening a web page in an applet
Some may recognize this as I have posted it before and got nowhere. So I decided to post it again to see if anybody could help me. I have made a few changes to my code, but no guarantees it's better.
public class FinalWindow extends Applet
private AppletContext appContext;
public void init()
java.net.URL url;
appContext = this.getAppletContext();
try
url = new java.net.URL("http://www.google.com");
} catch (Exception e)
System.out.println("Didn't work.");
url = null;
System.out.println("this");
try
if(url != null)
getAppletContext().showDocument(url, "_self");
//appContext.showDocument(url, "_self");
} catch (Exception e)
System.out.println("Error loading page.");
public static void main(String[] args)
FinalWindow fw = new FinalWindow();
fw.init();
}I have to things that i tried to use to show the web page in the applet, but they both produce NPE saying:
Exception in thread "main" java.lang.NullPointerException
at java.applet.Applet.getAppletContext(Applet.java:187)
at FinalWindow.init(FinalWindow.java:84)
at FinalWindow.main(FinalWindow.java:107)Let me know what ya'll think.wythe25 wrote:
No, I don't want the page to load in the browser window, I want it to load in the applet, as I said before.Your showDocument commands above would result in the target page replacing the page the applet is in, rather than opening the target page inside the applet.
To load a document inside the applet, might be achieved by using a JEditorPane to contain the HTML, then simply calling JEP.setPage(URL). Two things about that though:
1) An applet will need to be trusted in order to load documetns from foreign hosts.
2) Google frowns upon people reading their pages into any bot or software other than a standard browser.
I defined the main() method because that is the way I know how to do it. I'm not worried about having a main() in it right now. You should be. Combined applet/applications do make some sense during development - I do them quite often. But you need to realise that an applet launched that way will not be able to use the kind of things an embedded applet can normally expect to be able to access, such as the AppletContext. (1)
..I just can't figure out how to load a web page in an applet.
Basically making a web browser out of an applet that loads the page I tell it to in the code.JEditorPane (with a HyperlinkListener), trusted applet, not Google. And in fact, though the JEP is getting better over time, it is not generally considered to be good enough to use as the basis for a 'real world (wild web)' browsing component.
Edit 1:
(1) Having implemented a basic AppletContext for Appleteer , I can tell you it is not trivial!
Also, that code above was just one line short (the import for the applet package) of being an SSCCE *(<- link).* Please consider posting SSCCEs in future - you get better chance of help, faster.
Edited by: AndrewThompson64 on Nov 13, 2009 1:42 PM -
How to open NEW PORTAL PAGE from current portal page ?
I'm very confuse with my problem.
I have 2 portal page.
portal page I has 2 portlet : portlet A & portlet C.
portal page II has 2 portlet : portlet B & portlet C.
Now my customer want : start with portal page I, when i submit portlet A, program will open portal page II.
I don't know the way to call new portal page from current portal page. Help me, please.
Thanks.
Edited by: young_hero on Oct 30, 2008 1:12 AMCould you please help me how to call a .html page
from a Pl/Sql procedure or trigger ?
Thanks & Regards
Kalyani KothaKalyani,
Could you explain a little more exactly what you're trying to acheive? I'm not quite sure what it is you're asking for. Are you asking: "how would you/can you open a browser and direct it to a URL with PL/SQL?"
Earl -
Opening an HTML popup from Flash, not as tab
Hi
I need to open an HTML popup from Flash (using ActionScript in
Flex 4).
Thus far I found a solution, and it does work in Safari - a new
and separate HTML window is popped up (with a new web page).
private function popUpTheHtmlEditor():void {
var url:String = "http://www.adobe.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_blank');
} catch (e:Error) {
trace("Error occurred!");
But in (my) Firefox (with my settings), when I click on the Flash
(Flex) button, the page is being opened in a new tab.
I need a solution which pops up the HTML page in a new/separate
window, as far as possible regardless of the browser (and browser
settings).
I found an example where a popup is opened from HTML, and it opens a
separate window (a real popup) in my Firefox:
http://www.gtalbot.org/FirefoxSection/Popup/PopupAndFirefox.html
-> "Open a requested popup"
The JavaScript code seems to be:
OpenRequestedPopup(this.href, this.target); return false;
with this function def:
function OpenRequestedPopup(strUrl, strTarget)
if (WindowObjectReferenceOfRequestedPopup == null || WindowObjectReferenceOfRequestedPopup.closed)
WindowObjectReferenceOfRequestedPopup = window.open(strUrl, strTarget, "top=" + windowTop + ",left=" + windowLeft + ",width=" + windowWidth + ",height=" + windowHeight + ",menubar,toolbar,location,resizable,scrollbars,status");
else
if(WindowObjectReferenceOfRequestedPopup.focus)
WindowObjectReferenceOfRequestedPopup.focus();
How could I call such code from ActionScript? Should this work through
ExternalInterface? I couldn't even get this to work:
ExternalInterface.call('alert', 'foo');
Should I use swfobject.js for embedding the .swf in the HTML wrapper?
Any other ideas?
The two files are pasted below.
Here's the compiler command I'm using:
mxmlc -output button.swf -target-player 10.0.0 flash_to_editor.mxml
I'm running the examples locally (as files, not over http). Would it
help to place the files on a server?
Tobi
<?xml version="1.0" encoding="UTF-8"?>
<mx:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
horizontalAlign="center" verticalAlign="middle">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import flash.external.ExternalInterface;
import flash.net.URLRequest;
// This 'http://www.adobe.com' is just an example URL.
// Works but opens tab in FF (not a separate window):
private function popUpTheHtmlEditor():void {
var url:String = "http://www.adobe.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_blank');
} catch (e:Error) {
trace("Error occurred!");
// Doesn't work:
// var url:URLRequest = new URLRequest("javascript:alert('foo'); void(0);");
// navigateToURL(url, "_self");
// How to get this to work?
private function popUpTheHtmlEditor():void {
ExternalInterface.call('alert', 'foo');
// How to get this to work?
private function popUpTheHtmlEditor():void {
ExternalInterface.call('launch','http://www.adobe.com');
// Or
// ExternalInterface.call("window.open", "http://www.adobe.com", "win", "height=200,width=300,toolbar=no,scrollbars=yes");
// Perhaps it's necessary to try different approaches:
// (As soon as I get two approaches to work.)
private function popUpTheHtmlEditor():void {
var s:String;
if (ExternalInterface.available) {
// Necessary? Safe?:
// Security.allowDomain('*');
s = ExternalInterface.call('launch','http://www.adobe.com');
} else {
// TODO: Then try URLRequest?
s = "Wrapper not available";
Alert.show(s);
]]>
</fx:Script>
<s:Panel title="One way to open the HTML editor"
width="75%" height="75%">
<s:Button id="button" label="Open the HTML editor"
click="this.popUpTheHtmlEditor();"
horizontalCenter="0" verticalCenter="0"/>
</s:Panel>
</mx:Application>
<html
xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en">
<head>
<title>html_around_swf.html</title>
<script type="text/javascript">
function launch(url) {
alert(url);
// OpenWin = this.open(url, "FOO", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=400,height=200");
</script>
</head>
<body>
<object id="button" name="button" width="550" height="400"
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
<param name="movie" value="button.swf" />
<param name="allowScriptAccess" value="always" />
<embed id="foo" name="button" src="button.swf" width="550" height="400"></embed>
</object>
</body>
</html>Hi,
Here's a solution.
1. Make ExternalInterface work when files are loaded as local files:
Go to
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.htm l
In tab Global Security Settings: Edit Locations -> Add Location ->
browse to the .swf file, add it. Make sure it's in the list (under the
Edit Locations drop down, with a green check mark.)
Now open the HTML wrapper in a browser (eg Firefox).
Now this works (ActionScript):
private function popUpTheHtmlEditor():void {
ExternalInterface.call('alert', 'foo');
On Windows: perhaps:
http://techjig.blogspot.com/2008/03/flash-global-security-settings-windows.html
"In order for external interface functions to be called, you must also
specify the folder/file where the swf file is located."
The above setup isn't necessary when the files are on a server.
Also see:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/External Interface.html#call()
""ExternalInterface" "
"call() method"
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7ea6.html
"About ExternalInterface API security in Flex"
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf626ae-7fe8.html#WS2d b454920e96a9e51e63e3d11c0bf69084-7f31
"Using the ExternalInterface API to access JavaScript"
2. Open a real popup: Example:
ActionScript:
private function popUpSomething():void {
var editorPathOrUrl:String =
'wrapper.html';
var windowName:String =
"SomeNameSeeDocs";
var windowFeatures:String =
"toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,width=500,height=700";
ExternalInterface.call(
'launch',editorPathOrUrl,windowName,windowFeatures
JavaScript:
function launch(editorPathOrUrl,windowName,windowFeatures) {
windowRef = window.open(
editorPathOrUrl,windowName,windowFeatures
Works in all browser I tested except Opera.
Tobi -
Replace HTML page with an applet
Hello to everybody!
I created a servlet who can manage file upload from an HTML page.
Now I want to replace that HTML page with an applet.
I know that I need to use multipart/form-data , but I have no experience with applet.
HTML page code is:
<html>
<head><title>Upload</title></head>
<body>
<FORM ACTION="http://localhost:8080/examples/servlets/servlet/UploadTest" ENCTYPE="multipart/form-data" METHOD=POST>
What is your name? <INPUT TYPE=TEXT NAME=submitter> <BR>
Which file do you want to upload? <INPUT TYPE=FILE NAME=file> <BR>
<INPUT TYPE=SUBMIT>
</FORM>
</body>
</html>
Any help for "translating" this html page into an applet?
Applet will send, like html page, a string and a file.
Thanks in advance, LiukIf you use something like Apache Http Client you dont have to do any low level implementations.
Also if you are the one who is writing both servlet and applet you dot have to stick to standerd formats. you can develop your own format and write both servlet and applet to handle it. that kind of thing can be done easily even with URLConnection. But if you plan to send large files then URLConnection may not be the right option becouse I have seen many complaining that URLConnection gives OutOfMemoryErrors when uploading large amounts of data.
Maybe you are looking for
-
How can i move a single keynote cell to desktop?
Hello - Am using my keynote presentation as a basis for an imovie11 clip and want to modify a few cells in keynote. Have found it much easier to just drag the individual cells to desktop then import them into imovie11. However forgot how to drag them
-
Question about dates shown in finder
I have a problem and need help. First question is: what date is shown in default finder settings on files? Creating date , Modified or added Date? on Mac, Windows? The problem lies here, I have to give clients JPEG picture files. we had to re-shoot (
-
How do I push through an update to 5 or 6? Thanks in advance!
-
How to uninstall CS6 trial?
I am having the worst time trying to unistall the trial of CS6 and restore my computer to working order. As the trial expired, there is now a constant screen for me to enter the serial number for the dammn thing. When I try to quit and exit, it goe
-
Configure WCF client at runtime from XML file
Hi Since we use a special config system in our application that also uses xml files which are parsed at runtime, i also want/need to to integrate WCF configuration in our main config system. So we have only one config file and system. Our system is s