Refresh applet display in browser.

I have a JSP file which has an applet in it. The applet displays the correct text when the JSP is loaded from the server onto the client.
public void paint(Graphics g) {
g.drawString("Hello blimp ! ", 15, 15);
When the screen loads in browser I see "Hello blimp" in the applet window.
Now I have a public method callMeSucker() in the applet which is called by a javascript function depending on certain action by user.
public void callMeSucker()
this.getGraphics().drawString("applet refreshed! ", 15, 15);
this.validate();
After the user action I dont see the applet window refreshed with this message "applet refreshed! " . I have alerts around this method call to the applet and they get displayed. This shows that the applet method call is withour error but why is the display not getting refreshed.
Thx

This is just a guess, but maybe it is working -- but then the GUI threads call paint() again, immediately overwriting the "applet refreshed!" message so fast that you can't see it. I guess you could call this a conflict between active and passive rendering.
If this is the case, you could fix it by having a field in the applet, say:
private String message = "Hello blimp ! ";
public void paint(Graphics g) {
  g.drawString(message, 15, 15);
public void callMeSucker() {
  message = "applet refreshed! ";
  repaint();

Similar Messages

  • Problem in loading applet in HotJava browser

    I am having a problem in loading a simple applet in HotJava
    browser
    The code of the applet is shown below
    import java.awt.*;
    import java.applet.*;
    public class HelloJava extends Applet
    public void paint(Graphics g)
    g.drawString("Hello Java", 10, 100);
    The code of the HTML file HelloJava.html is shown below :
    <HTML>
    <! This page includes a welcome title in the title bar and also
    displays a welcome message. Then it specifies the applet to
    be loaded and executed.
    >
    <HEAD>
    <TITLE>
    Welcome to Java Applets
    </TITLE>
    </HEAD>
    <BODY>
    <CENTER>
    <H1> Welcome to the World of Applets </H1>
    </CENTER>
    <BR>
    <CENTER>
    <APPLET
    CODE = HelloJava.class
    WIDTH = 400
    HEIGHT = 200 >
    </APPLET>
    </CENTER>
    </BODY>
    </HTML>
    ON opening the HTML file in HotJava Browser, the following error comes up :
    HelloJava: class not loaded: file:/D:/Poonam/Java/Src1/HelloJava.class:
    java.lang.ClassNotFoundException: HelloJava: class not loaded: file:/D:/Poonam/Java/Src1/HelloJava.class

    Well the obvious question is what is utilities.PropertyManager up to at line 23? It appears to be trying to get the system classloader which applets aren't allowed to do.
    You should probably be using the ClassLoader from the class in question.

  • How do you capture system values to display in browser (drawString?)

    Hi to all,
    I'm attempting to get system.out.println values running an applet in a browser. I'm new to creating Applets and I see one option is to use drawString to display text. My code is as follows:
    import java.applet.Applet;
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    public class WhoAmI extends Applet{
    * Tells you the domain name and IP of the machine
    * you are running.
    * @param args not used.
    public String str2 = "test";
    public static void main (String[] args){
    try
    InetAddress localaddr = InetAddress.getLocalHost () ;
    System.out.println ( "Computer Name: " + localaddr.getHostName () );
    System.out.println ( "IP Address : " + localaddr.getHostAddress () );
    //System.out.println () ;
    String str = localaddr.getHostName();
    String str2 = str;
    //System.out.println ( "ALTERNATE LOCAL IP ADDRESSES:");
    InetAddress[] localaddrs = InetAddress.getAllByName ( str ) ;
    for ( int i=0 ; i<localaddrs.length ; i++ )
    if ( ! localaddrs[ i ].equals( localaddr ) )
    System.out.println ( "IP Address("+i+"): " + localaddrs[ i].getHostAddress () );
    //System.out.println ( "Local hostname : " + localaddrs[ i].getHostName () );
    //System.out.println () ;
    catch ( UnknownHostException e )
    System.err.println ( "Can't detect localhost : " + e +". Check Network settings.") ;
    public void init()
    Button button = new Button("Close");
    add(button);
    public void paint(Graphics g)
    g.drawString("I need the value of str variable from above to display here", 50, 25);
    // Head.
    public boolean action(Event evt, Object arg)
    if (arg == "Close")
    System.exit(0);
    return true;
    I've tried setting the localaddr.getHostName() value to string also trying to use a public variable name (str2) without success. How do you get a handle of the vale to display it?
    Thanks in advance,
    Geoff.

    thanks for the insight.. however using the above has spawned to be what seems as a security error:
    java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.SecurityManager.checkExit(SecurityManager.java:762)
    at javax.swing.JFrame.setDefaultCloseOperation(JFrame.java:356)
    at Test.<init>(Test.java:7)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at java.lang.Class.newInstance0(Class.java:306)
    at java.lang.Class.newInstance(Class.java:259)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:567)
    at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1778)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:496)
    at sun.applet.AppletPanel.run(AppletPanel.java:293)
    at java.lang.Thread.run(Thread.java:536)
    Is there something else I'm doing wrong here?
    Thanks for your help,
    Geoff-

  • How to run swing applets in a browser??

    I understand it is a typical question and there lot of articles on it. I tried but am confused. I installed JRE1.3 which has java plug-in along with it which supports swing applets in a browser.Once i got that plug in i also downloaded html converter but am confused how should i run my swing applet.Can anyone please explain in simple steps as to how to achieve this objective..Thanks much in advance..an example would be of real big help
    Thanks

    The below links will help you.
    http://java.sun.com/products/plugin//1.3/docs/index.docs.html
    http://java.sun.com/products/plugin/1.3/plugin.faq.html

  • Could not load applet in a browser using jre 1.6.0_06

    Hi,
    I am facing problem with loading applets when the browser uses jre 1.6.0_06.
    Not able to understand what actually the problem is, I tried to check with a small applet that would simply print Hello World on the java console. Even this applet also could not be loaded on the browser. I could load this applet in the test environment of eclipse, but not able to load it on the browser when the applet is deployed on Tomcat.
    We have no problems in loading applet if the browser is using an earlier version of the jre.
    One more thing we have found out that, if we change the SSL cipher suite of the ssl.conf file such that it can support weaker protocols, my applet works with jre 1.6.0_06 also.
    But one thing we could not understand is that why changes in SSL cipher suite of the ssl.conf file creates problem in loading the applet, only in case the browser is using jre 1.6.0_06. I mean to say that changes in the SSL cipher suite does not create any problem in loading the applet if my browser is using an earlier version of jre 1.6.0_06.
    Please help me out as I don't have any clue regarding this problem.
    Thanks in advance.

    Hi,
    We have found a wor around for this problem.
    The following option has been unchecked and the applet could be loaded.
    Go to java control panel
    Under the Advanced Tab
    Under the Security section
    Uncheck the last option "Use TLSv1.0".
    This makes the applet work.
    But could not understand as why this is creating a problem.
    We have tried to include TLSv1.0 in the cipher suite of our apache server, while keeping the above option in java plugin control panel checked, but even that did not solve the problem.
    Please help me of how should I proceed for this problem, as I am totally stuck.
    Thank you.

  • Adobe Reader X re-enabling "Display in browser" option by itself

    Hi all,
    I've ran into this problem with two users, but can't seem to figure out how to fix it. We've unticked the "Display in browser" option under Preferences a couple of times, but it always re-enables itself after a few hours. I've also disabled the browser addons, and they seem to stay disabled. Reinstallation on Reader X didn't help... Also I can't update the Reader to version 11, because that's not compatible with another software this company is using.
    Does anybody have any suggestions on how to fix this?
    -Ville

    Yeah, I just realized that this company hasn't updated it's Reader package in a while, so I already downloaded the newest version 10.1.4 and I'll try it this afternoon

  • Adobe Reader X 10.1.1: PDF does not display in browser

    Hello,
    If I click on a link to a PDF-file, this PDF-file does not display in browser eventhough I have checked "Display PDF in browser" (Preferences ==> Internet ==> Web Browser Options) but instead Adobe Reader X opens the PDF-file outside browser. What is wrong?
    Thank you for your help.

    I solved the problem. I used Internet Explorer, 64-bit. If I use Internet Explorer 32-bit the PDF-file displays in browser. If I use Internet Explorer 64-bit Adobe Reader X opens the PDF-file outside browser.

  • Transform for Reader 9.2 disables display in Browser

    Hi there,
    I use the Adobe Customisation Wizard 9 to create a MST file to transform the original Adobe Reader 9.2 msi file. Mostly I use it to automaticaly accept the EULA, but also for some other stuff. I leave the "Display in Browser" under "Online and Acrobat.com Features" untouched on "Enabled", but when the Reader is installed with that transformation file and I try to open a file in Internet Explorer, I get the message that the installed version can not be used to display PDF files in the webbrowser.
    After removing and installing the Reader without using my MST, displaying PDFs in the browser works again.
    Is the Customisation Wizard not compatible with Acrobat Reader 9.2?
    I have uploaded my MST here: http://ul.to/fqxogw
    Regards
    Christian

    I've looked through the 9.1.2 MSI that I have that works with browser integration and the 9.2 transform.  I can't find any difference in the Properties or registry entries, so I'm concerned that there has been a code change.
    I hope that more info is released on this "feature".

  • Oracle Database 11gR1 Enterprise Manager Console Cannot Display in Browser

    Folks,
    Hello. I am running Oracle Database 11gR1 with Operaing System Oracle Linux 5. I have some issues regarding EM connects with the Database Server as below:
    First, the default listener is LISTENER with standard port number 1521 and protocol TCP/IP.
    Its corresponding service naming S1 is with port 1521 and protocol TCP/IP and hostname localhost.localdomain.
    I run this listener in the following way:
    Step 1: [user@localhost bin]./lsnrctl start LISTENER (This command runs sucessfully.)
    Step 2: [user@localhost bin] ./sqlplus SYS/SYS as sysdba (This command starts sqlplus sucessfully.)
    Step 3: [user@localhost sqldeveloper] ./sqldeveloper.sh (This command invokes SQL Developer sucessfully.)
    But when start Enterprise Manager Console, it cannot connect with the Database. I do it in this way:
    [user@localhost bin] ./emctl start dbconsole
    The above command's output is:
    https://localhost.localdomain:1158/em/console/aboutApplication
    Starting Oracle Enterprise Manager 11g Database Control ... ...
    When open the link https://localhost.localdomain:1158/em/console/aboutApplication in browser, this message comes up:
    The connection to localhost.localdomain: 1158 cannot be established.
    Thus, I add Port Number 1158 into both LISTENER and Service Naming S1. I run ./emctl start dbconsole again and get this message:
    The connection to localhost.localdomain:1158 was interrupted while the page was loading.
    In order to solve the above issue, I create another listener LISTENER2 and another Service Naming S2 with Port Number 1158 and protocol TCP/IP because
    in my point of view, each listener only can have one Port Number(1521 or 1158) and its corresponding Service Naming (S1 or S2) need to have the same Port Number and Protocol (TCP/IP).
    But when I run [user@localhost bin]./lsnrctl start LISTENER2, this message comes up: the listener supports no service.
    From the message, it seems that LISTENER2 cannot work with its corresponding Service Naming S2 with Port 1158.
    EM with Port 1158 cannot display in Browser.
    My questions are :
    First, Is there any relationship needed to be established between listener(LISTENER2) and Service Naming(S2) in order to display EM in Browser ?
    Second, how do folks display EM in browser ?
    Thanks.

    Folks,
    Hello. Thanks a lot for replying. I do the following command: [user@localhost bin]$ wget http://localhost.localdomain:1158/em
    The command returns the message:
    --11:36:33-- http://localhost.localdomain:1158/em
    Resolving localhost.localdomain... 127.0.0.1
    Connecting to localhost.localdomain|127.0.0.1|:1158... connected.
    HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
    Length: unspecified
    Saving to: `em'
    [ <=>                                                                                                              ] 7 --.-K/s in 0.002s
    11:36:33 (4.15 KB/s) - Read error at byte 7 (Connection reset by peer).Retrying.
    --11:36:34-- (try: 2) http://localhost.localdomain:1158/em
    Connecting to localhost.localdomain|127.0.0.1|:1158... connected.
    HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
    Length: unspecified
    Saving to: `em.1'
    100%[=================================================================================================================>] 7 --.-K/s in 0s
    11:36:34 (16.8 KB/s) - Read error at byte 7 (Connection reset by peer).Retrying.
    The above message repeats again and again until finally returns the following message:
    11:39:02 (40.2 KB/s) - Read error at byte 7 (Connection reset by peer).Giving up.
    In browser, http://localhost.localdomain:1158/em cannot display and pop up a Windows with the message: You have chosen to open whicn is BIN file from http://localhost.localdomain:1158 What sholud FireFox do with this file ? Save to Disk ?
    My question is:
    I don't know how to display http://localhost.localdomain:1158/em in Browser. How to solve the issue ?
    Thanks.

  • Saving Applet display as an image... Java newb

    Hello,
    I'm using wirefusion3D to display and configure 3D objects on a website I've been developing. The only thing it lacks is the ability to save out an image of the current display, which I need to do in order to place those images on a pdf invoice.
    It does, however, have the ability to include custom java code within the applet, so I would like to create a function that will take a snapshot of the current rendered applet display and save that snapshot as a bitmap image on the server. I'm new to Java (I'm a PHP/Javascript guy), and have had no luck finding anything about how this would be done. I'm not really sure what to search for, as I don't really know what java functions/classes deal with this sort of thing.
    I was hoping someone could point me in the right direction.
    Thanks in advance

    1. If all the drawing is taking place in one J/Component, you can construct a BufferedImage, obtain a reference to its associated Graphics and call paint/Component passing the Graphics reference as parameter. Then save the image to a file.
    2. java.awt.Robot#createScreenCapture returns a BufferedImage which is a snapshot of the screen.
    db

  • "Internal error: An unexpected exception has occurred" error message displayed when browsing a cube.

    “Internal error: An unexpected exception has occurred“ error message displayed when browsing a cube.
    The error behaviour is quite irregular and does not occur for specific condition.
    Will cumulative update 9 for SQL Server 2008 R2 (SP1) installation help to fix the issue which is provided on the below link:
    (http://support.microsoft.com/kb/2152148)
    The current version of SQL Server I am using is as below:
    Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)   Jun 17 2011 00:54:03   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    Thanks in advance for the help!

    Hi Mon,
    The hotfix you said is for Microsoft SQL Server 2008. So it will not work on your scenario since you are using SQL Server 2008 R2.
    Based on the limited information, we cannot give you the exact reason that cause this issue. In order to narrow down this issue, you can apply the latest Service Pack and Cumulative Update as GregGalloway said. Besides, you can troubleshoot this issue by
    using the Windows Event logs and msmdsrv.log.
    You can access Windows Event logs via "Administrative Tools" --> "Event Viewer".  SSAS error messages will appear in the application log.
    The msmdsrv.log file for the SSAS instance that can be found in \log folder of the instance. (C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Log)
    Here is a blog about data collection for troubleshooting Analysis Services issues, please see:
    Data collection for troubleshooting Analysis Services issues
    Regards,
    Charlie Liao
    TechNet Community Support

  • Is it possible to run a website built in Java and applet from Safari browser in iPad

    Is it possible to run a website built in Java and applet from Safari browser in iPad?

    Java isn't supported on the iPad

  • Display of Browser and Fullscreen

    Hi,
    I'm on a MacBook with an external monitor connected to it. I want to display the Browser in the MacBook and the fullscreen picture at the external monitor. The MacBook is the first display and contains the dock bar.
    How should I configure the settings in Aperture? I'm trying this since one hours.
    Many thanks in advance.
    Tobias

    Tobias,
    I got the configuration you want once after many tries and could never get it to work again. I tried changing menu locations, all main and secondary settings yadda, yadda, yadda.
    I have done the opposite, my iMac as main in full screen and have the Browser on a secondary screen. To do this I have menus on Main screen, Main Screen set to Show One and Secondary Screen set to Desktop. I then resized the window in split screen mode (Browser and Viewer, no Inspector) and dragged it onto the Secondary screen, select a thumbnail and go into full screen using the HUD. Clicking the lock at top right of the HUD locks it to the right so it doesn't overlap the image.
    I hope this is helpful.
    Cheers,
    Terry

  • Page cannot be displayed in browser

    Hi,
       Recently I installed SAP NetWeaver 7.0 ABAP Trial version on Windows XP. Its working fine. Now I am using this as  a server and connected Two more systems with LAN.  Now I am working in Web Dynpro. In the server system its working fine. The pages are displaying in browser. But whenever I am trying in the client systems its not displaying. Its showing page cannot be display the webpage. Can anyone tell me that what settings need to be changed.
    Thanks

    Added Server IP in the Client hosts file.
    MS

  • Does anyone know why all of a sudden any new parent divs I add won't display in browser preview?

    Does anyone know why all of a sudden any new parent divs I add won't display in browser preview?

    yes styles are applied. What does not show up are the container divs - they all have the thin purple borders.
    The "Blog Lovers" image shows up but it is inside the #blogindex div - which seems to be invisible because the elements inside #blogindex div are just piled on top of each other. (see below html) This is now happening on all the pages of this site.
    (I test a different site in DW and I was able to add divs and borders and content inside divs just fine.)
    <!-- start #blogindex --> 
         <div id="blogindex">
            <div id="blog_image1"><img src="images/bloglovers.gif" alt="Blog Lovers" /></div>   
             <div id="blog_image2"><img src="images/gcblogheader350x70.jpg" alt="Gina Charles Blog" /></div>
          <div id="blogindex_text">
          <p class="blackbolditalic">Visit the blog for happenings, highlights and conversation! </p></div>
          </div>     
       <!-- end #blogindex -->
    http://www.newworldapparel.com/tests/  -scroll 1/2 way down page to see the "Blog Lovers" pile up!

Maybe you are looking for