Scrolling an applet in browser

I have an JApplet that containes to Jpanel (XYlayout)
Scrolling this applet in browser cause the screen to flash (blink)
Any idea why?

I have a vague recolection that this is something to do with double buffering, which is on and needs to be off or visa versa. I think it's somewhere among the GraphicsContext related objects.

Similar Messages

  • Why when i scroll my Applet (in browser) it presents flicker?

    Hi everybody,
    as said in title when i use the scrollbar of Internet Explorer the whole thing flickers tremendously.
    I used Swing.Why does this happen?
    Thank you,
    Chris

    Do a search on double buffering maybe.
    /k1

  • Problem in display file in java applet embeded browser

    hi, i am facing problem to display the file from local drive in java applet embeded browser. here is the error message i get:
    Exception loading file from path:java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)
    i think it should be the java security problem and i have try to get the solution from internet. i try to solve by using the fllowing method:
    keytool -genkey -keyalg rsa -alias yourkey
    keytool -export -alias yourkey -file yourcert.crt
    javac yourapplet.java
    jar cvf yourapplet.jar yourapplet.class
    jarsigner yourapplet.jar yourkey
    but the command prompt ask me to enter the keystore password. i try to enter any password. but i show me the error:
    keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect.
    So may i know what is the problem actually?Thanks a lot.

    Hi,
    here is the sample coding :
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import com.sun.j3d.utils.geometry.ColorCube;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import com.sun.j3d.utils.behaviors.mouse.MouseRotate;
    import com.sun.j3d.utils.behaviors.mouse.MouseZoom;
    import com.sun.j3d.utils.behaviors.mouse.MouseTranslate;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    import org.web3d.j3d.loaders.VRML97Loader;
    import com.sun.j3d.loaders.Scene;
    public class SimpleVrml extends Applet implements ActionListener {
    String           location;
    String           initLocation;
    Canvas3D     canvas;
    SimpleUniverse     universe;
    TransformGroup     vpTransGroup;
    VRML97Loader     loader;
    View          view;
    Panel          panel;
    Label          label;
    BranchGroup     sceneRoot;
    TransformGroup     examineGroup;
    BranchGroup     sceneGroup;
    BoundingSphere     sceneBounds;
    DirectionalLight     headLight;
    AmbientLight     ambLight;
    TextField      textField;
    Cursor          waitCursor;
    Cursor          handCursor;
    public SimpleVrml() {
    initLocation="cylinder.wrl";     
         setLayout(new BorderLayout());
         GraphicsConfiguration config =SimpleUniverse.getPreferredConfiguration();     
         setLayout(new BorderLayout());
         canvas = new Canvas3D(config);
         add("Center",canvas);
         panel = new Panel();
         panel.setLayout(new FlowLayout(FlowLayout.LEFT));
         textField = new TextField(initLocation,60);     
         textField.addActionListener(this);
         label = new Label("Location:");
         panel.add(label);
         panel.add(textField);
         add("North",panel);
         waitCursor = new Cursor(Cursor.WAIT_CURSOR);
         handCursor = new Cursor(Cursor.HAND_CURSOR);
         universe = new SimpleUniverse(canvas);
         ViewingPlatform viewingPlatform = universe.getViewingPlatform();
         vpTransGroup = viewingPlatform.getViewPlatformTransform();
         Viewer viewer = universe.getViewer();
         view = viewer.getView();
         setupBehavior();
         loader = new VRML97Loader();
         gotoLocation(initLocation);
    public void actionPerformed(ActionEvent ae) {
         gotoLocation(textField.getText());
    void gotoLocation(String location) {
         canvas.setCursor(waitCursor);
         if (sceneGroup != null) {
         sceneGroup.detach();
         Scene scene = null;
         try {
         URL loadUrl = new URL(location);
         try {
              // load the scene
              scene = loader.load(new URL(location));
         } catch (Exception e) {
              System.out.println("Exception loading URL:" + e);
         } catch (MalformedURLException badUrl) {
         // location may be a path name     
         try {
              // load the scene
              scene = loader.load(location);
         } catch (Exception e) {
              System.out.println("Exception loading file from path:" + e);
         if (scene != null) {
         // get the scene group
         sceneGroup = scene.getSceneGroup();
         sceneGroup.setCapability(BranchGroup.ALLOW_DETACH);
         sceneGroup.setCapability(BranchGroup.ALLOW_BOUNDS_READ);
         // add the scene group to the scene
         examineGroup.addChild(sceneGroup);
         // now that the scene group is "live" we can inquire the bounds
         sceneBounds = (BoundingSphere)sceneGroup.getBounds();
         // set up a viewpoint to include the bounds
         setViewpoint();
         canvas.setCursor(handCursor);
    void setViewpoint() {
         Transform3D viewTrans = new Transform3D();
         Transform3D eyeTrans = new Transform3D();
         // point the view at the center of the object
         Point3d center = new Point3d();
         sceneBounds.getCenter(center);
         double radius = sceneBounds.getRadius();
         Vector3d temp = new Vector3d(center);
         viewTrans.set(temp);
         // pull the eye back far enough to see the whole object
         double eyeDist = 1.4*radius / Math.tan(view.getFieldOfView() / 2.0);
         temp.x = 0.0;
         temp.y = 0.0;
         temp.z = eyeDist;
         eyeTrans.set(temp);
         viewTrans.mul(eyeTrans);
         // set the view transform
         vpTransGroup.setTransform(viewTrans);
    private void setupBehavior() {
         sceneRoot = new BranchGroup();
         examineGroup = new TransformGroup();
         examineGroup.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);
         examineGroup.setCapability(TransformGroup.ALLOW_CHILDREN_READ);
         examineGroup.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);
         examineGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
         examineGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
         sceneRoot.addChild(examineGroup);
         BoundingSphere behaviorBounds = new BoundingSphere(new Point3d(),
              Double.MAX_VALUE);
         MouseRotate mr = new MouseRotate();
         mr.setTransformGroup(examineGroup);
         mr.setSchedulingBounds(behaviorBounds);
         sceneRoot.addChild(mr);
         MouseTranslate mt = new MouseTranslate();
         mt.setTransformGroup(examineGroup);
         mt.setSchedulingBounds(behaviorBounds);
         sceneRoot.addChild(mt);
         MouseZoom mz = new MouseZoom();
         mz.setTransformGroup(examineGroup);
         mz.setSchedulingBounds(behaviorBounds);
         sceneRoot.addChild(mz);
         BoundingSphere lightBounds =
         new BoundingSphere(new Point3d(), Double.MAX_VALUE);
    ambLight = new AmbientLight(true, new Color3f(1.0f, 1.0f, 1.0f));
    ambLight.setInfluencingBounds(lightBounds);
    ambLight.setCapability(Light.ALLOW_STATE_WRITE);
    sceneRoot.addChild(ambLight);
    headLight = new DirectionalLight();
    headLight.setCapability(Light.ALLOW_STATE_WRITE);
    headLight.setInfluencingBounds(lightBounds);
    sceneRoot.addChild(headLight);
         universe.addBranchGraph(sceneRoot);
    public static void main(String[] args) {
    new MainFrame(new SimpleVrml(), 780, 780);
    cylinder.wrl :
    #VRML V2.0 utf8
    # A cylinder
    Shape {
    appearance Appearance {
    material Material { }
    geometry Cylinder {
    height 2.0
    radius 1.5
    view.html:
    <html>
    <applet code="SimpleVrml.class" width=600 height=600>
    </applet>
    </html>
    error msg that i get :
    Exception loading file from path:java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)
    i can display the wrl file in applet itself but i can't display in the browser.is it any problem with my code?Urgent, please help me. Thanks.

  • Help, how can i run JavaFX as Applet in browse

    can someone please tell me, how can i run JavaFX as Applet in browse
    thanks

    http://jfx.wikia.com/wiki/FAQ#What_is_needed_on_a_machine_to_run_JavaFX_applications.3F

  • How to switch between jre 1.5.0 and 1.4.2 when running applet in browser?

    Hi,
    I have JRE 1.5.0_05 and 1.4.2_04 installed and currently applet in browser is always run under jre 1.5. How to run the applet under jre 1.4.2 in browser?
    Thanks a lot

    Hi,
    Thanks for the info. I was thinking that the note didn't work for me, apparently I didn't use the conventional APPLET tag.
    Is there other way to switch JRE if I'm not using APPLET tag?

  • Cannot invoke Applet on browser...HELP!

    I cannot invoke Applet on browser however I can invoke the applet on appletviewer.
    Anyone that can help me?
    Thanks.

    youre gonna have some major headaches if your applet uses the swing package..
    IE's support for it is so flaky its not even funny
    If youre using awt then you really shouldnt have a problem viewing in a browser..
    just add this to your HTML code and you should be set
    <applet> code = "yourapplet.class" width = somenumber height = somenumber </applet>

  • Applet within browser not releasing file resource

    hi,
    I have an applet for ftp images upload.
    run from eclipse IDE (which uses applet viewer) the applet is ok.
    if i run my applet from browser here is what happens:
    i upload a file .& leave the browser opened.
    i then open this same file with gimp or photo-shop & get file in use error.
    if i close browser & try opening file .it works ok.
    why the file isn't released when applet instance still on browser ?
    is there a fix to this issue ?
    thanks for helping .

    thanks for prompt reply.
    yes i close all streams...
    the core method i use to upload files is below (client is a FTPClient object)
    private synchronized void putFile(File file, String remoteFile)
                   throws FileUploadException {
              String sFile = null;
              try {
                   sFile = r.chomp(remoteFile, '/');
                   client.put(file.getAbsolutePath(), sFile + file.getName());
                   r.numBytes += file.length();
              } catch (Exception e) {
                   //e.printStackTrace();
                   try {
                        retry(file, sFile);
                   } catch (Exception e1) {
                        throw new FileUploadException(e1.getMessage());
         }what am i doing wrong ?

  • How to interect with applet within browser

    i want to write a jws that can interact with the applet (inside browser)
    sample:
    i write a caculator, all the class are in jlnp(jws) except the interface,
    user only can access and see the interface(applet) when he/she come to my website. (ofcouse ,i just wan to promote my ad).
    so, can give me some hint how to interact jws and applet that within browser,
    like jws to

    Hi
    If your database is oracle 9i you connect to database throgh isqlplus.During the installation of database it diplays http server with port number.Check the port number with 7778
    ExmPLE : HTTP://MACHINENAME:7778/ISQLPLUS
    Regards
    Mohan

  • How to turn off automatic scrolling to top of Browser list?

    I'm having an issue in Aperture 3.2.1 that I've found to be very annoying.  I'm curious if there's a way to disable this particular behavior.  Opening an image from the Browser view causes the Browser list to scroll to the top upon closing the image.  In other words, if I double-click a picture in the middle of the Browser, view it, and then double-click again to return to the Browser, the thumbnail I just viewed is displayed at the top of the screen (the list scrolls automatically instead of returning to the previous list position).  This is frustrating when comparing similar images, because I have to scroll back up to see the related thumbnails.  I guess I just don't feel that the Browser interface should revert to a different view unless I asked it to do so.
    Scouring the Internet and these forums, I only came across one post that described this issue.  It was apparently unresolved. The thread can be viewed here:  https://discussions.apple.com/thread/2714848
    Is there a way to change this behavior in Aperture, or is it something I'm going to have to live with?

    Haha, that's OK, CalxOddity.  It took me a while to notice the behavior to begin with, as not all of my projects have enough pictures to produce a scrollbar. 
    Léonie, I think the random effect you're seeing may depend on the size of the album or project you're viewing.  The selected image needs to be "deep enough" in the list to revert to the top row, or else the scrollbar bottoms out.  Kinda the same thing when dealing with projects that are small enough to not require scrollbars.
    I suppose this is something I'll learn to live with, since it appears that everyone else is observing the same behavior.  See, I'm coming from using Photoshop and Finder individually to manage my photos, and I do an awful lot of comparison viewing.  Icon view in the Finder, along with Quick Look, made this job really easy.  Quick Look in Aperture would be awesome...
    Thanks for all of the replies, everyone.  I'm glad we've discussed this particular mannerism of Aperture, since the earlier thread (as linked by Frank and myself) didn't really go anywhere.  Regards!

  • 2nd Class not displaying in applet on browser

    I have a very basic applet that consists of two classes, the applet itself and a gui component class that I created that is used in the applet. When I run it in the AppletViewer, I can see my gui component on the applet just fine. But when I try to run it in the browser, I can only see the applet but not the my gui component class. Both class files are in the same folder as the HTML page. I tried putting both classes in a jar file and using the archive attribute in the applet tag of the HTML file but that didn't help. I even tried putting the entire gui component class inside the applet class. It worked fine in the AppletViewer but not in the Netscape browser.
    I'm probably missing something really simple here but I can't figure out what it is. Anybody have any ideas?

    Okay, I've whittled the code down to the bare minimum. I have an applet with a single ProgressBar class on it. The applet is in the AIControl.class file and the ProgressBar is in the ProgressBar.class file, both in the same directory. When I run it in the AppletViewer, I see a half full blue progress bar at the bottom of the applet. When I run it in the browser, I only see the blank applet with no progress bar. I'm sure I'm missing something really stupid but I don't see it. Thanks all for your help.
    /************** AIControl.java ***************/
    import java.awt.*;
    import java.applet.*;
    import java.util.*;
    public class AIControlPanel extends Applet
    ProgressBar prgProgressBar = new ProgressBar();
    public void init()
         setLayout(null);
         setBackground(java.awt.Color.lightGray);
         setSize(517,431);
         add(prgProgressBar);
         prgProgressBar.setBounds(12,398,492,16);
    /************* ProgressBar.java *************/
    import java.awt.*;
    public class ProgressBar extends java.awt.Canvas
    private int percentDone = 50;
    public void paint(Graphics g)
    double myWidth = getSize().getWidth() - 1;
    double myHeight = getSize().getHeight() - 1;
    g.setColor(Color.black);
    g.drawRect(0, 0, (int)myWidth, (int)myHeight);
    g.setColor(Color.blue);
    g.fillRect(0, 0, (int)(myWidth*((double)(percentDone)/100)), (int)myHeight);
    The HTML file I'm using to run this applet in the browser is bare bones and is as follows:
    <HTML>
    <HEAD>
    <TITLE>Autogenerated HTML</TITLE>
    </HEAD>
    <BODY>
    <APPLET CODE="AIControlPanel.class" WIDTH=517 HEIGHT=431></APPLET>
    </BODY>
    </HTML>
    I don't think I can get much more bare bones than that...and it still doesn't work. Can anyone see what I'm missing?

  • LightweightDispatcher issue with Applets in Browser using Java 7, not 6

    Spent the last year at work setting up some GUI JApplets for demos our of code. The JApplets house a number of layers of JPanels and JComponents, but should have no heavyweight components as children. I've set up standalone applications that run one of the JApplets as a child of a JFrame, and those demos have no trouble. When I run the same demo but as a JApplet in a browser, I get errors. Please note that the demo is a JApplet but written like the demo that uses a JFrame, so the JApplet causing an issue is a child of the JApplet the browser knows about.
    The issue is seen when the user mouses-over the child JApplet. The listener of the component being moused-over is trying to send an event that the LightweightDispatcher is erroring trying to retarget. It does not seem to find the component that should be receiving the event. For reference, the JApplet implements the mouse-listener interface and is set as the mouse-listener for all its children recursively. Here is the error that is seen:
    Exception in thread "AWT-EventQueue-2" java.lang.AssertionError
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.trackMouseEnterExit(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
         at java.awt.EventQueue.access$000(Unknown Source)
         at java.awt.EventQueue$3.run(Unknown Source)
         at java.awt.EventQueue$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
         at java.awt.EventQueue$4.run(Unknown Source)
         at java.awt.EventQueue$4.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    and it repeats that for every mouse event that tries to fire within the child JApplet.
    Any thoughts on what this could be?
    I had a similar issue with key strokes not finding the focused JComponent within the child JApplet, but I made my own KeyboardEventManager to handle that issue. Unfortunately there are no paths like that to override for the mouse listeners, not to mention that there is no focused object for the events erroring.
    I do see that when I stop adding the mouse-listeners then the error does not appear, so I'm sure its related to that.
    I suppose the most important note here though is that the JApplets were built using Java 6, but the error is seen when running the JApplet with the 1.7 JRE. Also, the JApplet is opened using a JNLP. When the JNLP is set to run at 1.6+ the demo runs fine, when set to 1.7+, the error is seen.
    Please let me know if anyone has seen this or has a solution, or if I should report this as a bug to Oracle.

    This shouldn't be the case. You did make sure you are pointing the applet at the plug in correct? That means you are using an <object> tag as opposed to the <applet> tag in the HTML file?
    If not, run your HTML page through the HtmlConverter that comes with the plugin and try using the resulting HTML.
    Bryan

  • DISPLAY APPLET IN BROWSER

    hi ..... i'm asking about solution for my problem which is how can i let my browser (explorer oR Netscape) to read from file and write to file in my pc..
    my applet is working with AppletViewer which i can read and write to file in my pc ,but when i load it in the Browser(netscape) it just read and do't write....
    in the explorer it not reading and not writing ..
    i changed the security in the browser option ,,,but no thing happend ...
    i need solution please for my problem ,,,and if you can tell me about browser which will do it for me ,,(i tried hotjava browser)
    thanx

    You need to sign your applet...see link below for info and example on how I did it:
    http://home.attbi.com/~aokabc/FileIO/FileIOdemo.htm
    The first few links in this page will give you the info you need to get started.
    V.V.

  • Applet launching browser window in Java 6u10+

    Finding a problem that appears to be limited to Java 6u10+. We have an applet which opens multiple JFrame windows, and in some cases, the user might click something in the applet that should trigger the browser to show a popup browser window with some web page. That part all works fine, and the browser popup shows in the front as it should in older java versions.
    However, it appears that since 6u10, now that the applet process is separate from the browser, the popup window no longer can be brought to the front of the applets. It is being launched and brought to front with Javascript, but that only brings it in front of other browser windows, no longer in front of the applet. And the only thing I can find to resolve this is to minimize/iconify the applet windows, and that's not ideal to hide all windows.
    Is there anyone else seeing this? Has anyone found any fix or work around for this (without minimizing all the applet windows)?
    thanks

    in Java 6u10 it works?
    I guess it's similar. My applet calls showDocument(), but it is only passing a URL with query string parameters which the page called reads (via Javascript) and uses JS to call window.open() with the contents based on those parameters. I don't have access to the system to change the way the web works. The team that does has looked into it, and said they do make the tofront call in JS to push the browser window up. But it won't go up all the way, only above other browser windows, and not the applet window (which is a JFrame). Then the OS (windows in this case) starts blinking the taskbar button for the popup window for attention, but that's not helpful.
    The only common factor in the reports were that it's Java 6u10 or higher. XP, Vista, FF, IE, all had the problem with 6u10+. And knowing how Sun changed the plug-in architecture, it actually makes some sense as to why this happens. However, this seems to be something that there is no way to fix short of Sun doing something. Or as mentioned, minimize my window just to let others show up, which is going to be annoying as a user to have to restore the window to go back.

  • Removing white border around applet in browser?

    Greetings All,
    My applets are surrounded by a white border in Netscape and IE. Can I get rid of it so that the applet goes from edge to edge in the browser control? (Looks like default 5 pixel Hgap is in force, is this the case, and if so can it be overridden without access to the source code?)
    TIA,
    Dave.

    Hi, Even when you assign 100% to width and height you will notice one black border around applet in case of IE5.0 When I go in to full srceen mode in IE 5.0 It should not show me scrollbars.
    But because of this border scrollbar remains

  • Spry Tabbed Panels - How do I force the active panel to scroll to top of browser?

    I have some tabbed panels about 600px down a page. When one of the tabs is selected I would like the tabbed panels to scroll to the top of the browser window as per the function on this page: <http://www.godaddy.com/email/online-storage.aspx?ci=55860>
    The URL for my development page is: <http://www.worldchallenge-internationalschools.com/dev/asia/asia.html>
    Can anybody please shed some light on how to do this? It's driving me crazy. Any suggestions appreciated!

    It appears to me as if this might work by an on-page link/anchor, because that is what happens when you click an on-page anchor link: the selection pops to the top of the screen. If that is it, it is not Spry, it is simple <a href...> code.
    The problem is that there is also coding going on, with javascript, and links don't work as usual on tabs in Spry.
    Perhaps this will bounce to the top and Gramps will check in with some words of wisdom regarding this question.
    Beth

Maybe you are looking for

  • Memory Question??? Where's Jocko?

    I have a question on the memory frequencey showing in the bios of my motherboard it states that I have 200ddr is this correct? I have pc3500 mushkin 222. Is there a way to change this or is this just the way it shows? amd 64 3400+ kt8 neo 34 gig wd 1

  • Wondering whether to get a mac mini starting at $599 or a mac-book air 11 inch.

    Hi I'm wondering whether to get a mac mini 2012 starting at $599 or the 11 inch macbook air (newest version as of this post. For about a year and a half I will use it for light gaming (minecraft) and miscellaneous web surfing (Youtube, and other teen

  • A bug in the "You're not subscribed" message

    There is a bug that I wish would get fixed...................... Whenever I go to a channel that I know I am not subscribed to, such as Cinemax (Channel 420 in New Jersey), and if I don't change it from that channel and instead I watch a video on my

  • Load Bill of Material (BOM) using DTW?

    I had a question, I was wondering how do we load BOM using DTW? Which template to use Thanks in advance

  • 10 Ways to Enable IT Innovation in the Enterprise

    Calling all East Coast New Relic users! After a summer hiatus, New Relic User Groups are back with four big meetups in September. Read More This topic first appeared in the Spiceworks Community