JApplet focussing problem

I have a JApplet in which i have a JTabbedPane. My problem is that in Internet Explorer the focus does not stay on the applet and i have to click on the applet to activate it first and then i can use it. Can anyone tell me how to set the focus on the applet when it loads.

does using requestFocusInWindow have some pre conditions. It did not workNo.
post a sample program that we can compile and run
just the gui stuff, that way we can see how you're adding what to where
Message was edited by:
Michael_Dunn
I said no, but yes, the component has to be displayable/ visible etc
as per the api docs
the timer should overcome that, but if the timer didn't work,
then posting your code would quicken a solution

Similar Messages

  • JApplet debugging problem

    Hi there all:
    I'm having a problem with debugging a JApplet. I created a new workspace, project and applet and didn't make any changes to anything. When I try to debug the applet, I get these messages:
    System Error: java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup )
    System Error: java.lang.Object java.lang.Class.newInstance0()
    System Error: java.lang.Object java.lang.Class.newInstance()
    System Error: java.applet.Applet sun.applet.AppletPanel.createApplet(sun.applet.AppletClassLoader)
    System Error: void sun.applet.AppletPanel.runLoader()
    System Error: void sun.applet.AppletPa
    System Error: nel.run()
    System Error: void java.lang.Thread.run()
    If I change the object from a JApplet class to an Applet class, I can debug just fine.
    Anyone know what's going on here?
    Thanks
    Jeff

    Me again. Was doing some searching on the net about this one since I've gotten no response.
    Found this at Inprise (Borland) about a debugging problem with JBuilder3 (I assume that the base of jdev is still JBuilder).
    http://community.borland.com/article/0,1410,19739,00.html
    To quote from their document--------
    Question:
    I can't seem to debug Applets with JBuilder3 Standard. If I attempt to debug my Applet
    I recieve the following error:
    java.security.AccessControlException: access denied (java.lang.RuntimePermission
    modifyThreadGroup )
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:195)
    at java.security.AccessController.checkPermission(AccessController.java:403)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    Why?
    Answer:
    In a nutshell this is an installation problem with JBuilder3 Standard edition.
    The install for JBuilder3 Standard did not provide the file 'DebugApplet.policy'.
    To resolve this problem download the file from the following URL:
    http://www.borland.com/devsupport/jbuilder/downloads/DebugApplet.policy
    After you have downloaded the file, copy the file to your JBuilder3\bin directory.
    This will fix the problem.
    You can also cut and paste the following:
    (NOTE: create the file DebugApplet.policy in your JBuilder3\bin directory)
    //DebugApplet.policy
    // These policy permissions are needed for the AppletViewer used by sun.tools.debug.
    grant {
    permission java.lang.RuntimePermission "accessClassInPackage.*";
    permission java.lang.RuntimePermission "modifyThread";
    permission java.lang.RuntimePermission "modifyThreadGroup";
    permission java.net.SocketPermission "*", "accept, connect, listen, resolve";
    permission java.util.PropertyPermission "appletviewer.version", "read";
    permission java.io.FilePermission "<>", "read";
    permission java.security.AllPermission;
    Could this be a problem in JDev3 too?
    Jeff
    null

  • JApplet initialization problem

    I am experiencing a problem with a JApplet that has me perplexed... I wrote the JApplet to act as a front end to a servlet. I am using the Jakarta Tomcat server to execute both the servlet and to serve the web page which contains the applet. The html page containing the applet has been configure to load the latest JRE plugin into a users browser, if need be, and that works OK. When I run the applet from a browser on my own system, I don't have any problems, but when I tried to load the applet over the internet, at a friends house, I get the following walkback... Seems to be complaining about a "no proxy"... Can anyone tell me what this means? The applet does use Swing components, but my understanding is that is OK so long as the latest JRE plugin is installed. My server is up an down a lot, as I develop this application, but you are free to give the applet a try and let me know what you see... The URL is http://www.marcchamberlin.com/control.htm and don't be surprised that it is slow to respond, that is done on purpose so give it a minute... Any help would be much appreciated... ;-)
    Opening http://www.marcchamberlin.com/javax/swing/JApplet.class no proxy
    load: class DisplayStarChart.class not found.
    java.lang.ClassNotFoundException: DisplayStarChart
    at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:385)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:462)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:395)
    at sun.applet.AppletPanel.run(Compiled Code)
    at java.lang.Thread.run(Thread.java:474)
    P.S. What are Duke Dollars???? Seems to be a lack of documentation about them ;-)

    Seems to work OK for me. I got the applet, no problem, and the star-chart was a grey area with the text "star chart goes here". Eventually, the real star-chart appeared (and mighty cool iot looked, too ;-). Here's the output from my Java console:
    Servlet URL = http://www.marcchamberlin.com/servlet/StarChartServlet
    Servlet URL = http://www.marcchamberlin.com/servlet/StarChartServlet
    Attempting to connect to Star Chart Servlet
    Attempting to connect to Star Chart Servlet
    Connection to servlet has succeeded!
    Servlet URL = http://www.marcchamberlin.com/servlet/StarChartServlet?user=userIdent&move=RA%3A+19h30m00.00sDEC%3A+%2B0%B00%270.0%22FOV%3A%2B20%B000%2700%22&date=2001-6-1T10%3A54%3A11
    Attempting to connect to Star Chart Servlet
    Connection to servlet has succeeded!
    Maybe the "no proxy" thing on your friend's system is because he/she is behind some kind of "difficult"' firewall, or the ISP has some strange proxy setup or something?? (I'm using a router as a firewall, and have no proxy set up). Anyway, I get the impression that it's the hardware, not your software, that is the problem. Maybe try it from somewhere else (the local library?!?)

  • Japplet jxl problem

    I have a java application. I tried to concvert it to applet by modifying it like deleting the called methods that are only available for JFrame etc.. my first question is
    can an applet work without an init or start method? it has a constructor but it does not have an init method.
    second is:
    my program reads an excel file and prints out results of the search.
    I included jxl.*. Worked fine in my computer (AS A PROGRAM). Now it is an applet but does not work on my website. I have also put jxl.jar to my website's storage area incase a problem occurs and jvm could not find it but nothing happened. the error is as follows:
    java.lang.NoClassDefFoundError: jxl/JXLException
         at newclaplet.init(newclaplet.java:12)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    I would be grateful if you can help me. Thank you for helps.

    Seems to work OK for me. I got the applet, no problem, and the star-chart was a grey area with the text "star chart goes here". Eventually, the real star-chart appeared (and mighty cool iot looked, too ;-). Here's the output from my Java console:
    Servlet URL = http://www.marcchamberlin.com/servlet/StarChartServlet
    Servlet URL = http://www.marcchamberlin.com/servlet/StarChartServlet
    Attempting to connect to Star Chart Servlet
    Attempting to connect to Star Chart Servlet
    Connection to servlet has succeeded!
    Servlet URL = http://www.marcchamberlin.com/servlet/StarChartServlet?user=userIdent&move=RA%3A+19h30m00.00sDEC%3A+%2B0%B00%270.0%22FOV%3A%2B20%B000%2700%22&date=2001-6-1T10%3A54%3A11
    Attempting to connect to Star Chart Servlet
    Connection to servlet has succeeded!
    Maybe the "no proxy" thing on your friend's system is because he/she is behind some kind of "difficult"' firewall, or the ISP has some strange proxy setup or something?? (I'm using a router as a firewall, and have no proxy set up). Anyway, I get the impression that it's the hardware, not your software, that is the problem. Maybe try it from somewhere else (the local library?!?)

  • JApplet getImage problem

    hi!
    I have
    public class myapplet extends JAppletclass and I`m trying to load image inside init() method:
    Image img = getImage(getDocumentBase(), "x.jpeg");File "x.jpeg" exist, and I am sure that it is in right place. But after getImage() img variable is wrong initiate, his height and width have -1 value.
    I have trying run this code under eclipce applet simulator and on server, but in both case it didn`t work.
    What is the problem?
    bye!

    The loading is asynchronous... You need to refresh your data until the image is loaded, or wait for the image to be loaded to get them :
    Image img = getImage(getDocumentBase(), "x.jpeg");
    MediaTracker mt = new MediaTracker(this);
    mt.addImage(img,0);
    mt.waitForId(0);
    int w = img.getWidth(this);
    int h = img.getHeight(this);

  • JApplet load problem on Linux

    Hi All
    I am having a lot of trouble with my Java Applet. Heres the situation. I have created a signed applet that is able to create and write to a log file. The whole thing is being hosted on a Linux machine.
    If i access the applet from a Windows machine, it works perfectly, create the file, writes to it, reads it.
    However if i access the applet from a Linux machine, the console displays the following error:
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.access$100(Unknown Source)
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    I cannot see what the problem is. The Linux box will download the certificate fine and once i've accepted it it just throws up this error.
    Does anyone know what this might be due to? and why Windows can display it but Linux cant?

    Are you sure that you have the correct JVM installed
    on your Linux box? It seems you're using an old JVM
    that doesn't recognize your classes.

  • Troubleshooting focussing problem.

    I am having many componets onthe Panel(acutully inside many panels). i just want to pass the focus from one JTextArea to another JTextArea. I gave the code to work accordingly. but something getting focus in the middle. I want to just troubleshoot it.
    can anyone give a clue.
    Thanks

    i am using the following code for FocusTraversalPolicy. The problem is that i am using txtCmd and txtServerLists are TextAreas. Though i apply i didnot succed. in both TextAreas and another JTablePanes are used JScrollPanes.
    final Component order[] =
                    new Component[] {txtCmd,txtServerList,clear,start};
              FocusTraversalPolicy policy = new FocusTraversalPolicy() {
                    List list = Arrays.asList(order);
                    public Component getFirstComponent(Container focusCycleRoot) {
                      return order[0];
                    public Component getLastComponent(Container focusCycleRoot) {
                      return order[order.length-1];
                    public Component getComponentAfter(Container focusCycleRoot,
                        Component aComponent) {
                      int index = list.indexOf(aComponent);
                      return order[(index + 1) % order.length];
                    public Component getComponentBefore(Container focusCycleRoot,
                        Component aComponent) {
                      int index = list.indexOf(aComponent);
                      return order[(index - 1 + order.length) % order.length];
                    public Component getDefaultComponent(Container focusCycleRoot) {
                      return order[0];
                  };

  • JApplet Reloading Problem

    Hi,
    I am developing a Swing applet, which actually runs quite a heavy application. It uses at least two jar files too.
    the functionality requires that i open the page containing in a new browser window. I do that using window.open() successfully.
    Once the applet is loaded and working, i close the child window. (the client might always do that...) And then i click again on the link for opening the applet in a new browser window (the original place for firing the applet), what i expect is that the applet should reload itself.
    But that's not what is happening. It doesn't do anything written inside any of the methods, i.e. all of the init, start etc. are skipped.
    And effectively, i have to have a fresh instance of browser (parent) to be able to launch the applet again.
    Could anybody throw some light on this thing. What i want is that the applet should be loaded again whenever i click on that link for loading it.
    any sort of help would do.
    thanks and regards
    raghav..

    An applet will only be reloaded if the browser's cached copy is older than the one that resides on your server. In your case the applet is the same only the data it's displaying is different, what you should do is make sure that whatever component you used to display the data is repainted by calling the repaint method.
    ;o)
    V.V.

  • Problem in using custom java beans

    Hi,
    We are using oracle JDeveloper 3.2.2 version for developing our Graphical User interface which
    involves Applets and custom beans.
    We faced the following problems when we tried to add the custom beans to JApplet.
    Problem 1. When I drag and drop the custom beans to JApplet, the gif image used by the bean is
    not displayed even when the gif image has been added in the archive file representing
    JavaBean
    Problem 2. When I modify the source code generated by Jdeveloper and come back to the design tab,
    the custom beans looses its look and feel and gets the look and feel of the standard
    bean from which it has been extended.
         For instance, I have a dropdownlist which has been extended from JCombobox.
         I drag and drop to the JApplet. The look and feel of the dropdownlist is
    maintained.
    Now I modify the source code for the dropdownlist in order to add items to it.
         After doing so, I come back to the design tab where i can see my dropdownlist
    appears with the look and feel of JCombobox.     

    HI,
    IF YOU create custom object the profile should be the same as standard.Also see whether the authorization object is added to the data target or not.
    Hope this helps
    Assign points if useful
    Regards,
    venkat

  • Problem : com.ms.security.SecurityExceptionEx

    I don't find the solution about my problem:
    I have a JApplet, any problem when I compile. BUT
    in internet explorer I have this exception :
    com.ms.security.SecurityExceptionEx ....
    please help me....

    Check out the MS Knowledge Base article number Q175622, "PRB: SecurityExceptionEx Exception Running a Java Applet". It should contain the information you need.

  • Disappoint​ing camera of lenovo a6000

    Same picture clicked multiple times and result is a piece of crap, each n everytime same picture most of time blurred .it seems the camera app having some kind of focussing problem.
    Since i am also using sony Ericsson phone with 5 mp at back is superior than what lenovo a6000's 8mp.

    the shots r hit n miss mostly miss

  • Nikon Lense compatibility

    My D40X pooped out and I want to buy a D5100 (body Only).  Will my lenses and speedlight work with the 5100?  I have a Nikon ED AF-S Nikkor 70-300 1:4.5-5.6G and a Nikon DX AF-S Nikkor 18-55 1:3.5-5.6 G II ED lense.  Also:  Nikon SB800 speedlight.
    Solved!
    Go to Solution.

    When I did a search on D5100 models on BBuy site, there is more than one product and there are 247 reviews on one model.  Is this the review you are referring to?
    http://www.bestbuy.com/site/Nikon+-+D5100+16.2-Megapixel+DSLR+Camera+-+Black/2553883.p?skuId=2553883...
    My thoughts....
    It is one review out of many.  I did not see any other reviews with focussing problems he is describing.
    He mentions trying to focus 1 foot from the lens.... most lenses need 2 or 3 feet to auto focus properly.  That lens needs 11", so he's just barely giving the lens enough clearance to focus.  He mentions everything is "one plane".  At 1 foot?  That does not count.
    did he have enough light?  Lens needs enough light to auto focus.  You mentioned having a SB800.  Use the autofocus light to help with the auto-focus.
    did he have enough contrast?  If everything is one colour it can be hard to autofocus
    there are only 11 focus points on this older, entry model.  You might want newer higher end models with more focus points.  Love the 51 autofocus points my Nikon's.
    more expensive models also have more cross-type focus points.  Entry models might only have ONE.
    I had problems with the D700 with a tamron lens (28-300mm).  Once I replaced the third party lens with a Nikon.... the focussing problems went away.
    http://www.youtube.com/watch?v=DVQiN568izQ&hd=1

  • How to implement code with in the destory method

    Created a chat room in Java (JApplet)
    The problems is when leaving the browser window the applet does not
    inform the server, the coding that I have tried to implement is embedded the destory method
    public void destory()
    terminate();
    I am using the right method?
    is there a easy solution?
    terminate method sends a message to the server informing that the client wishes to leave the chat room, on receiving the message the server removes all references to that client. This method is also used in a button event or when the user enters TERMINATE in the text field so I know it works. If any body could give hints or a sun page to look at for information it would be much appreciated.
    Thanks in advance
    Phil

    slight clerical error in spelling thanks,
    but any solution to the problem a part from spelling error in
    message.
    thanks Phil

  • Autofocus in 808

    There is sometimes problem in focussing on plain and uniform objects. I've attached two examples. This also happens with focussing on the sky, but unfortunately no attachment of it.
    Why is this problem? My old N82 used to focus on everything except that taken in low light.
    But this 808 PV have focussing problem.
    Anyone having same issue? Any solution or is it a bug?
    THANK YOU
    If this post was useful, click the white star.
    Nokia 808 with Belle FP2 (113.010.1506)
    Type RM-807
    Product code 059p7z2
    Attachments:
    shot_037_2013_01_24.png ‏295 KB
    shot_038_2013_01_24.png ‏299 KB

    Anyone please? 
    THANK YOU
    If this post was useful, click the white star.
    Nokia 808 with Belle FP2 (113.010.1506)
    Type RM-807
    Product code 059p7z2

  • Swing layout/size problem with JFrame and JApplet.

    I have a class that extends a JFrame, the classes layout is BorderLayout. I then have a class that extend JApplet, this classes layout is GridBagLayout (this class has a JTabbedPane - which contains JPanels). The problem I'm having is no matter how big I make the size of the applet or frame (using setSize), the applet/frame stays the same size - no matter how large I make it.
    Can anyone please help?
    Thanks,
    dosteov

    Here is the basic code:
    Thanks in advance,
    dosteov
    public class EADAdm extends JApplet
    EADAdmFrame theFrame = new EADAdmFrame(this);
         public void init()
              // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller
    //          symantec.itools.lang.Context.setApplet(this);
              // This line prevents the "Swing: checked access to system event queue" message seen in some browsers.
              getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
              // This code is automatically generated by Visual Cafe when you add
              // components to the visual environment. It instantiates and initializes
              // the components. To modify the code, only use code syntax that matches
              // what Visual Cafe can generate, or Visual Cafe may be unable to back
              // parse your Java file into its visual environment.
              //{{INIT_CONTROLS
              getContentPane().setLayout(new GridBagLayout());
              setEnabled(false);
              getContentPane().setBackground(java.awt.Color.lightGray);
              setSize(800,800);
              getContentPane().add(AdmTab, new com.symantec.itools.awt.GridBagConstraintsD(0,1,2,1,0.5,0.5,java.awt.GridBagConstraints.CENTER,java.awt.GridBagConstraints.HORIZONTAL,new Insets(3,12,4,14),120,120));
              AdmTab.setFont(new Font("Dialog", Font.PLAIN, 12));
              titleLbl.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
              titleLbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
              titleLbl.setText("EAD Administration");
              getContentPane().add(titleLbl, new com.symantec.itools.awt.GridBagConstraintsD(0,0,1,1,0.0,0.0,java.awt.GridBagConstraints.CENTER,java.awt.GridBagConstraints.NONE,new Insets(12,36,0,0),307,15));
              titleLbl.setForeground(java.awt.Color.blue);
              titleLbl.setFont(new Font("Dialog", Font.BOLD, 15));
              exitBtn.setText("Exit EAD Administration");
              exitBtn.setActionCommand("Exit EAD Administration");
              getContentPane().add(exitBtn, new com.symantec.itools.awt.GridBagConstraintsD(0,2,2,1,0.0,0.0,java.awt.GridBagConstraints.CENTER,java.awt.GridBagConstraints.NONE,new Insets(6,371,10,14),66,8));
              exitBtn.setFont(new Font("Dialog", Font.PLAIN, 12));
         //theFrame.setVisible(false);
         login();
         AdmTab.addTab("Administration", new LogoPanel() );
         userPanel = createUserPanel();
         AdmTab.addTab("Edit Users", userPanel );
         fpoPanel = createFPOPanel();
         AdmTab.addTab("Edit FPO", fpoPanel );
         regulationPanel = createRegulationPanel();
         AdmTab.addTab("Edit Regulations", regulationPanel );
         rolloverPanel = createRolloverPanel();
         AdmTab.addTab("Rollover", rolloverPanel );           
              //{{REGISTER_LISTENERS
         SymMouse aSymMouse = new SymMouse();
              this.addMouseListener(aSymMouse);
              SymAction lSymAction = new SymAction();
              exitBtn.addActionListener(lSymAction);
              SymKey aSymKey = new SymKey();
              this.addKeyListener(aSymKey);
         theFrame.getContentPane().add(this);
    public class EADAdmFrame extends JFrame
    EADAdm theApplet;
    public EADAdmFrame(EADAdm theMainApplet)
              //{{INIT_CONTROLS
         //     theApplet = theMainApplet;
         //     this.getContentPane().add(theApplet);
              getContentPane().setLayout(new BorderLayout(0,0));
              getContentPane().setBackground(java.awt.Color.lightGray);
              setSize(1000,1000);
              setVisible(false);
         theApplet = theMainApplet;
              //{{REGISTER_LISTENERS
              SymWindow aSymWindow = new SymWindow();
              this.addWindowListener(aSymWindow);
              SymComponent aSymComponent = new SymComponent();
              this.addComponentListener(aSymComponent);

Maybe you are looking for