Hyperlinks from an Applet

Hi,
I was wondering if we can have hyperlinks in the applet. I have a Table which has 6 columns and some thousands of rows of data. I want to provide hyperlinks for each row in the first column. Is there any way that i can do it. I tried searching in the forum theards but could not get a clue on how i should be doing it.
I'm new to java..! Please help..
Thanks

here is the basic of it compile the code an try it
import java.awt.*;
import java.net.*;
import java.applet.*;
import java.awt.event.*;
public class testing1 extends Applet implements MouseListener {
public void init() {
addMouseListener(this);
setBackground(Color.black);
public void mouseClicked (MouseEvent me) {
try { URL url = new           URL("http://javaboutique.internet.com/tutorials/"); 
getAppletContext().showDocument(url,"_self");
}catch(Exception tr) {}
public void mouseEntered (MouseEvent me) {}
public void mousePressed (MouseEvent me) {}
public void mouseReleased (MouseEvent me) {}
public void mouseExited (MouseEvent me) {}
click anywhere in the applet it will link to the url

Similar Messages

  • Including hyperlink in the applet

    how do can i include a hyperlink in the applet

    hi there EXPERT
    sorry for the question format.
    Here is what i want to do!! Firstly i'm writing a converter
    from some another lang. to Java. I'm implementing it using
    the applets. That lang can include the "labels" as hyperlinks.
    so if there are lots of labels, i need to find out whether it
    is associated with a url or not and make that label a hyperlink
    accordingly. so what this means i need to add the hyperlinks
    to the applet as and when there are "url labels" in the other
    lang window.
    following is a simple applet,plz explain me how to add hlinks
    to it.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.lang.*;
    import javax.swing.*;
    /*<applet code= "try1" width = 200 height = 300>
    </applet>*/
    public class try1 extends Applet implements FocusListener
    TextField tx2;
    public     void init()
         setLayout(new FlowLayout(FlowLayout.LEFT));
              Label l1 = new Label ("Name");
              Label l2 = new Label ("Address");
              TextField tx1 = new TextField(20);
              tx2 = new TextField(20);
    //i need to add the hyperlink here
              Button ok = new Button("Ok");
              Button cancel = new Button("Cancel");
    //and here also
              add(l1);
              add(l2);
              add(tx1);
              add(tx2);
              add(ok);
              add(cancel);
    public     void start()
    public     void paint()
    Ashish

  • Opening and closing a frame from an applet security problem

    can I open a frame or a window from an applet and close the frame by using
    System.exit(0) for the frame or will it throw a security problem.

    I am using system.exit(0) to exit the JVM.
    dispose()
    Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. That is, the resources for these Components will be destroyed, any memory they consume will be returned to the OS, and they will be marked as undisplayable.
    If this frame have to be close and open again don't use dispose.
    there is no check whether a frame is active? what you can do is set the the new frame to null (frame = null) and also when you dispose it, this will let you know if the frame is active or not.
    Noah

  • Is a Windows registry error responsible for Firefox opening two browser windows whenever I use a hyperlink from a Word file?

    Whenever I use a hyperlink from an MS Word document, Firefox opens two windows instead of one. The first window is the one I need. The second contains a message that the page could not be found and the address bar contains the URL appended with "Firefoxhtml/shell/open/command".
    This problem is similar but NOT identical to one in MozillaZine headed "Windows error opening internet shortcut or local HTML file - Firefox". But none of the solutions in that article work for my problem: I've disabled all extensions but that hasn't helped. I've tried editing file types so that the DDE is removed (I'm not a teccie so have no idea what that means), but after following the instructions to the letter it doesn't seem to remove the DDE. Also I read that removing the DDE is not a good idea for people like me who need to open numerous firefox browser windows at one time. Furthermore, the MozzilaZine article refers only to problems opening a URL link in a MS Outlook email when Firefox is NOT running. My problem concerns the opening of URL links in MS Word when Firefox IS running!
    I've run countless different virus programmes, rootkit checkers etc but they all come up blank. However, I did come across guidance on this website: http://antivirus.about.com/od/windowsbasics/a/shellopen.htm which suggests that something may have altered the shell open command for two registry keys used by Firefox.
    # HKEY_CLASSES_ROOT\htafile\shell\open\command
    # HKEY_CLASSES_ROOT\htfile\shell\open\command
    The default value for each of these should be "%1" %*. But on my user, the default value reads:
    (for htafile) c:\windows\system32\mshta.exe "%1"%*
    (for htfile) c:\programfiles\windowsNT\hypertrm.exe"%1
    What should the value be for these two files?
    Can anyone sort this for me please? Bear in mind I'm not a teccie!

    Do a malware check with a few malware scan programs.<br />
    You need to use all programs because each detects different malware.<br />
    Make sure that you update each program to get the latest version of the database.
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    *http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    See also "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked and [[Searches are redirected to another site]]

  • Hyperlink from PL SQL Report to a branch

    Hi,
    Is there a "good" way to hyperlink from PL SQL report to a branch?
    I cant use the regular report, as there is a lot of data and I need to control the layout.
    I would like to go to another page and pass data to one known field.
    Have tried googling and I found this page:
    http://www.lucidprocess.com/blog/building-hyperlinks-in-oracle-apex-reports/
    But it seems a bit "hacky", eg.. many places to edit if the page where to move or change in the future (or if one copies the page).
    Is there a more "clean" way to do this, or does one have to get his/her hands dirty for such a task?

    Thank you.
    I managed to write the other code too:
    "f?p='||:APP_ID||':686:'||:APP_SESSION||'::'||:DEBUG||'::P686_TBNR,P686_VIS_REGISTER:'||oppdrag.PE_TBNR_BET||'%2CHUSKNYTT"instead of firing the branch and using JS, I just set the two fields that change the logic and basis of the page. However as you see, the "flaw" with the code I wrote, is that if the fields or anything were to change, it will be harder to go in and edit reports that have this type of code.
    Have just started with APEX, but I must say I like it a lot..
    Just wish there where something inbetween the sql reports and the pl sql reports..
    The possibilities of the PL SQL Reports meeting the SQL Reports flexibility would be super.
    However, maybe it's good not everything is served on a plate, as this forces me to learn it more in depth. I also love challenges and I like making things properly :-)

  • Is it possible to pass a string from an applet to the web site?

    Hi, everybody!
    Is it possible to pass a String from an applet to a web site (as a field value in a form, an ASP variable, or anything else). Basically, I have a pretty large String that is being edited by an applet. When a user clicks on the submit button, a different page will show up which has to display the modified string. The String is pretty large so it doesn't fit into the URL variable.
    Please, help!
    Thank you so much!

    Why do you want to do this in Java?
    Javascript is the correct language for these type of situations.
    for instance:
    in the head of your html document:
    <script language=javascript type="text/javascript">
    createWindow(form){
    if(form.text.value!=""){
    newDoc = new document
    newDoc.write(form.text.value)
    newWin = window.open(document,'newWin','width=200;height=150')
    </script>
    in the body:
    <form onSubmit="createWindow(this)">
    <p>
    Enter a String:<input type=text size=30 name="text">
    </p><p>
    <input type=submit value="submit"> 
    <input type=reset value="reset">
    </p>
    </form>

  • Launching Web Start Program from an Applet?

    Hi,
    I need to launch web start program from an applet.
    How can I do that?
    I have tried opening a new web page pointing to the jnlp file from an applet. But, that does not seem to start the web start.
    Thanks in advance
    rg

    I am new to this so may be my questions will appear stupid to a pro, but this is an erro I am getting at compile:
    Can't make static reference to method java.lang.Process exec(java.lang.String) in class java.lang.Runtime.
         Runtime.exec("test.exe");
    What could be the problem?
         ^

  • Print HTML doument without open it from an applet

    I need to know how I can print an HTML document from an applet developed with Jbuilder 4. I'm not a very expert developer and I need a detailed information about this problem. Important is that the HTML document is printed without open it.
    I use: win 2000 pro
    J2RE 1.4.0
    thanks in advance for your help
    Mauro Losa

    Thanks for your help but my problem is that i want print the document without display it.
    I think to have find a solution using Java Print Service API (JDK 1.4) but when i run the example the system display this error refered to this instruction
    "PrintService[] pservices = PrintServiceLookup.lookupPrintServices(flavor, aset);":
    java.lang.UnsatisfiedLinkError: getDefaultPrinterName
    at sun.print.Win32PrintServiceLookup.getDefaultPrinterName(Native Method)
    at sun.print.Win32PrintServiceLookup.getDefaultPrintService(Unknown Source)
    at sun.print.Win32PrintServiceLookup.getPrintServices(Unknown Source)
    at sun.print.Win32PrintServiceLookup.getPrintServices(Unknown Source)
    at javax.print.PrintServiceLookup.getServices(Unknown Source)
    at javax.print.PrintServiceLookup.lookupPrintServices(Unknown Source)
    at untitled4.applet1.main(Applet1.java:32)

  • 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 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".

  • Activate a Midlet from an Applet

    Hi,
    I am trying to activate a Midlet from an Applet? Is this possible in any of the latest J2ME releases?
    Using SATSA I am able to send APDU commands from the Midlet to the Applet and start a scenario where my Applet and Midlet exchange information.
    Is this available in the opposite direction. I want that my Applet, when triggered by an event, be able to Activate\Wake Up the Midlet.
    I am a newbie to J2ME and after researching the web, still couldn't find an answer. Thanks for your help.
    Bye.

    You can communicate with servlet from an applet, using URL connection, and then send POST/GET methods through HTTP protocol, here is a code snippet,
    // applet side, this method will send a POST method to the servlet and then get url openstream to read a
    // returned object from the servlet, params should be in the form param1=value&param2=value etc...
    public Object getObjectFromServlet(String servletName,String params) {
        Object object = null;
        try {
          URL url = new URL(codeBase,
                            contextRoot + servletName + params);
          URLConnection con = url.openConnection();
          con.setUseCaches(false);
          InputStream in = con.getInputStream();
          ObjectInputStream result = new ObjectInputStream(in);
          object = result.readObject();
          result.close();
          in.close();
        catch (ClassNotFoundException ex) {
          System.err.println("ClassNotFoundException caught:" + ex.getMessage());
        catch (MalformedURLException ex) {
          System.err.println("MalformedURLException caught:" + ex.getMessage());
        catch (IOException ex) {
          System.out.println("IOException caught:" + ex.getMessage());
        return object;
    //servlet side
    public void doPost(HttpServletRequest request, HttpServletResponse response){
          //Extract all the necessary supplied parameters from the request object and configurations.
           String param1 = request.getParameter("param1");
           String param2 = request.getParameter("param2");
      try {
            ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream());
            out.writeObject(object);
            out.close();
          catch (IOException ioe) {
            System.err.println("IOException caught:" + ioe.getMessage());
    }

  • Closing browser window from an Applet?

    I've written a series of applets that perform different functions. I placed a button on each applet with the purpose to close the window in which that applet is running. However I don't even know where to start looking to find out how to make my applet close it's own browser window. I know how to open a new browser window from an applet but not vice versa.
    Can anyone help please?
    Mark.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

  • 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

  • Accessing JavaScript function from an Applet?

    Hi,
    I've found how to access an applet's method from Jscript, but can we do the inverse? I'd like to refresh some frames in my web pages from my applet.
    The refresh of several frames could be done with a Jscript function but how can I call it from my applet?
    Thanks!
    Stephane

    actually look at this link to make more sense
    http://www.woodger.ca/jv_jsint.htm

  • 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.

Maybe you are looking for

  • Price difference in PO-invoice to different Consumer Account

    Hello, I have the following situation: Purchase Order: 10 units  x 1000 USD  = 10000     (Account assigned : u201CKu201D) Goods Receipt:  10 units (x 1000 USD) = 10000    (valuated GR against consumer account) PO u2013 invoice:     10 unitos x 1100 U

  • ATI driver for win7 Macbook pro 2010 anyone got it working?

    I'm trying to get the windows7 ati driver to work. Loaded the bootcamp drivers but the display driver is just the generic monitor resolution 1280 x 1024.

  • Downloaded elements for mac air and is in german

    elements for mac air downloaded in german would like english

  • OAS Dr. Watson errors

    We've been using OAS v4.0.7 on Win NT v4.0/SP3 for about two years now. We have it configured to run with the Oracle 8.0.5 database using a pl/sql cartridge and this has been extremely stable. We have a large number of procedures written to handle in

  • Replacing existing template - need to add editable regions

    I've created a new design for my website and created a new template that uses the same editable regions so it will correctly update all of the existing pages based on the old template.  How can I add new editable regions to the template?  I was told