Applet borders in browsers

I am running a Swing applet in a side frame of a browser window. My problem is that the applet is drawn with a border that is completely wasted space. Is there anyway to make the applet take up the entire area of the frame rather than leaving this space. My HTML code looks like:
<HTML>
<HEAD>
     <TITLE>Help Example</TITLE>
</HEAD>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="100%" height="100%">
<PARAM NAME="code" VALUE="docplugintool.CDocPlugInTool">
<PARAM NAME="archive" value="DocPlugInTool.jar, jaxp.jar, parser.jar">
</OBJECT>
</HTML>
I've tried using the vspace and hspace tags but they don't help. Any ideas?

I am running a Swing applet in a side frame of a
browser window. My problem is that the applet is drawn
with a border that is completely wasted space. Is
there anyway to make the applet take up the entire
area of the frame rather than leaving this space. My
HTML code looks like:
<HTML>
<HEAD>
<TITLE>Help Example</TITLE>
</HEAD>
<OBJECT
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="100%" height="100%">
<PARAM NAME="code"
de" VALUE="docplugintool.CDocPlugInTool">
<PARAM NAME="archive" value="DocPlugInTool.jar,
ar, jaxp.jar, parser.jar">
</OBJECT>
<BODY MARGINHEIGHT=0 MARGINWIDTH=0 LEFTMARGIN=0 TOPMARGIN=0>
</BODY>
</HTML>
I've tried using the vspace and hspace tags but they
don't help. Any ideas?

Similar Messages

  • Java Control Panel wont open at all and any Java Applets crash web browsers

    Hello,
    I recently installed a fresh fully updated copy of Windows 7 Home Premium 64 bit, and I have not for the life of me been able to get Java working at all. Java version is the latest JRE 6U31. I only have Internet Explorer 9 installed but I doubt it is a browser issue since I cannot even open the Java control panel. I have tried using the 32 bit version of Java, and the 64 bit. Anytime I try to open the Java control panel with either 32 bit or 64 bit, I get an error message (click link below to view error message):
    http://i65.photobucket.com/albums/h204/gobigjeff/Java%20Error/javaerror.png
    I can only bring up the Java Control Panel using the command “javaws –viewer” . Anytime I try to load a web page with a Java applet in either 64 bit or 32 bit, it freezes and crashes. I am running Internet Explorer 9 and have tried both the 32 bit and 64 bit browser versions. I saw Java’s recommendation to only use the 32 bit version so I have mainly been trying to get the 32 bit version working 1st, with no success. I have tried ALL of the following steps, and have done some exhaustive research on this problem. It seems others have had this issue as well, with no solution to be found:
    •     Uninstalled and reinstalled only Java 32 bit JRE 6u31 multiple times (Used Javara and reg cleaner to remove all old Java traces)
    •     Uninstalled and reinstalled only Java 64 bit JRE 6u31 (Used Javara and reg cleaner to remove all old Java traces)
    •     Uninstalled and reinstalled bit JRE 7 (Used Javara and reg cleaner to remove all old Java traces)
    •     Used SFC /scannow in safe mode to verify Windows files
    •     Ran spyware and virus scan with no issues detected
    •     Added all java processes to windows firewall
    I am out of solutions here. If anyone has had this problem with Java or knows what I need to do to fix the problem your advice would be greatly appreciated. I don’t think reinstalling windows is the solution because this is a fresh install.
    Edited by: 918650 on Mar 4, 2012 1:16 PM

    I figured it out. I changed the installation folder to C:/Java and it finally worked!

  • Running a Java Applet on Mac OS browser

    I'm having trouble getting my Java Applet to work properly on the Mac OS version of IE5. Basicaly, the app fails to appear. Are there any do's and don'ts regarding the running of Java Applets on Mac Browsers?
    I read somewhere that you can't send parameters through to the Applet. Is that true? I'm not trying to do this and it's still doesn't work.
    Any help would be appreciated.

    If anyone can help me with this problem I would be greatful.

  • Applets are not shown

    I have A problem as a beginner.
    I wrote a HTML script in which some Java Applets were included. After compiling the Applets with Java 1.2 the files were uploaded. But the Applets were only shown on those Computers, on which Java was installed, using both the Internet Explorer 6 and Firefox 1.5
    I was surprised because I thought hat there are Plugins for Java Applets in the browsers and therefore the installation of Java is not necessary to show Java Applets.
    What is wrong? Can anyone help me?
    Thank you
    Peter

    IE might have something called the msjvm to run applets for you but there are
    distributions where it has been removed.
    Firefox does not have build in java support.
    If the applet does not show in IE, it might not have msjvm or the applet caused an
    exception (security settings?). Check the java console in IE for more info.
    http://support.microsoft.com/kb/q241111/

  • Applet-Panel, background color and size problem

    I am writing an applet with simple form.
    Form is having 3 rows and 2 cols (label and textfield). Each row I want to display in different color. So I created each row with 2 separate panel (one for label and one for text field - of which I set the backgroung color).
    The total form is in one panel with grid layout (2 colmns).
    My problems are
    1)The space between label and text field (col width) can not be resized. I tried to use setSize but not giving any effect.
    2)Another problem is when I am seting the background color, the textfield is also changing the color (textfield I want to white color only). This does not have any effect on Choice
    3)The first label I wanted to use simple break but could not. I tried \n\t, \n, chr(13) + chr(10) etc but not getting any result so created separate panel.
    My code goes here:
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    public class test1 extends Applet{
    protected TextField refnoTextField=null, payerTextField=null, amtTextField=null;
    protected Choice typeChoice;
    public void init() {
         /* The mainPanel layouts components with BorderLayout manager
              which will hold form and button panel */
         Panel mainPanel = new Panel(new BorderLayout());
         Panel taxformPanel=new Panel(new GridLayout(3,2));
         Label l;
         //panel for tax ref no label
         Panel refnoLabelMainPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
    //here wanted to use simple line break but \n\t does not seems to work not even chr (10), chr(13)
    //so created separate panel (Payment Voucher Or \n\t Reference no.
         Panel refnoLabelPanel = new Panel(new GridLayout(2,1));
         l = new Label("Payment Voucher Or");
    l.setFont(new Font("Helvetica", Font.BOLD,10));
         refnoLabelPanel.add (l);
         l = new Label("Tax Reference No:");
    l.setFont(new Font("Helvetica", Font.BOLD,10));
         refnoLabelPanel.add (l);
         refnoLabelMainPanel.add(refnoLabelPanel);
         refnoLabelMainPanel.setBackground(Color.blue);
         //panel for tax ref no text field
         Panel refnoTextFieldPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
         refnoTextField = new TextField(20);
         refnoTextFieldPanel.add(refnoTextField);
         refnoTextFieldPanel.setBackground(Color.blue);
         //panel for tax type label
         Panel typeLabelPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
         l = new Label("Tax Type:");
    l.setFont(new Font("Helvetica", Font.BOLD,10));
         typeLabelPanel.add (l);
         typeLabelPanel.setBackground(Color.yellow);
         //panel for tax type choice
         Panel typeChoicePanel = new Panel(new FlowLayout(FlowLayout.LEFT));
         typeChoice = new Choice();
         typeChoice.add("Personal Tax");
         typeChoice.add("Income Tax");
         typeChoicePanel.add(typeChoice);
         typeChoicePanel.setBackground(Color.yellow);     
         //panel for tax payers name label
         Panel payerLabelPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
         l = new Label("Tax Payer's Name:");
    l.setFont(new Font("Helvetica", Font.BOLD,10));
         payerLabelPanel.add (l);
         payerLabelPanel.setBackground(Color.blue);
         //panel for tax payer field
         Panel payerTextFieldMainPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
         Panel payerTextFieldPanel = new Panel(new GridLayout(2,1));
         payerTextField = new TextField(20);
         payerTextFieldPanel.add(payerTextField);
         l = new Label(" (as per NRIC or Passport)");
    l.setFont(new Font("Helvetica", Font.BOLD,8));
         payerTextFieldPanel.add (l);
         payerTextFieldMainPanel.add(payerTextFieldPanel);
         payerTextFieldMainPanel.setBackground(Color.blue);
         taxformPanel.add(refnoLabelMainPanel);
         taxformPanel.add(refnoTextFieldPanel);
         taxformPanel.add(typeLabelPanel);
         taxformPanel.add(typeChoicePanel);
         taxformPanel.add(payerLabelPanel);
         taxformPanel.add(payerTextFieldMainPanel);
         /* buttonPanel to hold all buttons */
         Panel buttonPanel = new Panel();
         buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
         Button continueButton = new Button("Continue");
         continueButton.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                        continueButtonAction();
         Button clearButton = new Button("Clear");
         clearButton.addActionListener(new ActionListener()     {
              public void actionPerformed(ActionEvent e)     {
                   clearButtonAction();
         Button cancelButton = new Button("Cancel");
         cancelButton.addActionListener(new ActionListener()     {
              public void actionPerformed(ActionEvent e)     {
                   cancelButtonAction();
         buttonPanel.add(continueButton);
         buttonPanel.add(clearButton);
         buttonPanel.add(cancelButton);
         mainPanel.add("Center", taxformPanel);
         mainPanel.add("South", buttonPanel);
         add(mainPanel);
    } // public void init()     
    public void continueButtonAction() {
         MessageDialog d=new MessageDialog("Confirm","Continue? ",true, 430, 150);
         System.out.println ("Continue Button Pressed");
    }//continueButtonAction
    public void clearButtonAction()     {
         System.out.println ("Reset Button Pressed");
    }//clearButtonAction
    public void cancelButtonAction()     {
         MessageDialog d=new MessageDialog("Confirm","Cancel Button ? ",true, 430, 150);
         System.out.println ("Cancel Button Pressed");
    } // cancelButtonAction
    } // TaxPaymentApplet3
    Please help,
    manisha

    I do not want to go into detail, but there are some hints you can follow.
    I am talking about AWT, not swing, you should decide which one you will use and don't mix the two of them.
    If you want to run your applet in current browsers without requiring the java plugin, you should be aware, that most browsers support old versions of java and many convenient methods and classes are missing :-(
    So
    You can change the size of a label by putting it in a panel ( labelPanel ), whose layout is set to FlowLayout. Then you put in labelPanel another empty panel ( emptyPanel ), whose layout is set to null, and you set the width of the empty panel to whatever you want ( this is the gap between the label and the next component ), an the height to the least nonsero number possible, i.e. 1. Well, you can add to the labelPanel more components, if you wish. So, when you want a gap, use an empty panel with a fixed size.
    You cannot use line break in a label. You should place more labels in a panel instead. I am not sure if the direction of FlowLayout can be set to vertical, but very probably it can. If so, that is your solution. If not - see what other layout managers you have available, but make sure your choice belongs to java.awt ! BorderLayout allows you to use up to three labels (=> 3 lines). And if nothing fits your needs, ... write a layout manager.
    Well, hope I could help.

  • Applet goes crazy

    I am fairly new to java, and completely new to this forum, so I am not sure if this is where this question is supposed to go, but here it is anyway.
    I am trying to write a poker program, that shows the pictures or the card. However, when i run the .html file with the applet in it, it appears that the program runs many many times. It shows words overlapping, and whenever i minimize and restore it, a new set of cards appears. I want it to run only once. Also, if i scroll in the window, the pictures of cards become messed up, with sections of card being replaced with other sections.
    Another question. When using the getImage(getCodeBase(), picture) method, why can I only use that in the paint method. If i try to use it in another part of the program, it sats that getImage and getCodeBase are not static.
    hopefully you understood my questions, and any help is appreciated.

    have you tried running the applet in various browsers? sometimes applet support is quite bad in some browsers
    and for the static thing - do you know what static means? it means that there can be only one instane of this object, var or method
    you probably made something static - and these methods are in Applet i think so if you're not in a class extending Applet it won't wotk

  • Using RMI from applets

    Hi everyone,
    I have an applet that uses RMI to communicate with an RMI registry that is on the originating server for the applet. To enable the applet to make RMI calls over port 1099 I have had to modify the policy file of my Java plug-in (to grant socket permissions to the server over port 1099).
    My understanding was that applets by default were able to communicate with their originating servers. Is this correct?
    I am asking because I want end-users to be able to use this applet in their browsers without having to perform any security configurations. At the moment, if they don't have a Java plug-in, one will be automatically downloaded and installed on their system (which is great). But, as the application currently stands, they will then have to make an additonal step to modify their policy file.
    This doesn't seem right to be. Any suggestions?
    Thanks in advance.
    Kind regards,
    Ben Deany

    I tried this a couple of years ago. In theory, it should work. If I remember correctly, I believe that the RMI API kept trying to crawl out of the sandbox by doing things that seemed to have no relation to RMI. Finally, I got a certificate and life got much simpler.

  • How to get applets running with Java Plug-in on Win but also on Mac OS X???

    I've converted to the use of Java Plug-in for my applets, but I need to have those same applets executable from browsers on Mac OS X platform. Surely this has been done, but I don't see how. The browsers I've tried on Mac OS X (Netscape, IE) don't seem to recognize the <OBJECT> tag used for the java plug-in. I've seen no news about the Java plug-in being ported to Macs. How can one get the same applet to run with the Java plug-in on Windows browsers, and also to run with at least one of the common browsers on Mac OS X? Any help would be SO much appreciated!

    Those ten dukes look good to me. But the passing of fifteen months has me thinking you've probably moved on. In any case, here's my effort.
    I've been through a trial trying to get my applet, developed with 1.4.1_03, to run on my Mac OS X v.10.2.6 in multiple browsers. I'm posting my results here. Comments and feedback are welcome.
    JVM support for 1.4.1 is limited to the Safari browser. All other browsers running in Mac OS X that I've tried ( Camino, Opera, Internet Explorer, Mozilla ) are using the 1.3.1 plugin. According to a bug report by Mozilla on this topic ( see Bugzilla Bug # 197813 http://bugzilla.mozilla.org/show_bug.cgi?id=197813 )
    with the release of Apple's version of Sun's Java 1.4.1 the applet programming model has changed, and only Safari has adapted with this change. Other browsers, according to the report, could not because of a lack of documentation. The use of the MRJCarbon plugin offered by Mozilla (here - http://www.mozilla.org/oji/MRJPluginCarbon.html) only allows Mozilla to use the J 1.3.1. And I have not found any information on the Microsoft site about how to get IE 5.2 to recognize the newer version of Java.
    Regarding the use of the OBJECT tag in Safari, it is a matter of debate. A current post on this topic exists in the Applet Development forum:
    http://forum.java.sun.com/thread.jsp?forum=421&thread=441002
    In my experience, I have not been able to determine that Safari v1.0 recognizes the OBJECT tag. My experience is that the APPLET tag is required to run applets in Safari. The Bugzilla report echoes the problem with the BadMagicNumber error that can arise in Safari. Nonetheless, I enjoy Safari and I enjoy Mac OS X.

  • Signed applets (are policy files needed!)

    I have experienced on a number of different machines that a signed applet that the client trusts (via clicking on yes to the prompt asking to trust the applet), is able to access the local resources with NO policy file on the client machine. I'm using JRE 1.4.1_02
    Is this the expected behavior?
    I sure hope it is because how in the world can you install applications to many clients and update their policy file? you can't via the web! BUT why am I reading that you have to have a policy file even if you sign an applet. I want to get rid of using Netscape security model but I can not update many client machine policy files... Please help!!! thanks. Is signing an applet all you have to do to access local machines, I sure hope so! Thanks in advance.

    I've done some more research specifically a very good article at http://developer.java.sun.com/developer/technicalArticles/Security/applets/index.html. I'll try to highlight the more interesting comments that I found. At least for the JRE 1.3 there appears to be a new class loader, sun.plugin.security.PluginClassLoader that allows a signed jar file (once trusted by the client) to have access to local resources.
    Code signed using the private key of the signer can be run on client machines once the public key corresponding to the signer is deemed as trusted on the respective machine.
    Applet security in browsers strives to prevent untrusted applets from performing potentially dangerous operations, while simultaneously allowing optimal access to trusted applets.
    There is no simply way to deploy and use customized policy files, a policy will have to be set by files based on the JRE installation. Customized class loaders or security managers cannot be installed easily.
    Policy files are difficult or at least not very straightforward for normal users, which could be thousands of machines where an applet is deployed.
    The java plug-in (I believe its 1.3 and later) provides a workaround although its recommended to use policy files wherever practical and applicable. (This implies to me that using the plug-in, all that is required is to sign the jar file to have access to local resources).
    RSA-signed applets can be deployed using the Java plug-in. (which can run in an identical way for Netscape and IE).
    In order for a plug-in enhanced browser to trust an applet and grant it all privileges or a set of fine-grained permissions (as specified in a J2EE policy file), the user has to preconfigure his or her cache of trusted signer certificates (the .keystore file in JRE 1.3) to add the applet's signer to it. However, this solution does not scale well if the applet needs to be deployed on thousands of client machines, and may not always be feasible because users may not know in advance who signed the applet that they are trying to run. A NEW CLASS LOADER, sun.plugin.security.PluginClassLoader in the Java Plug-in 1.3, OVERCOMES THE LIMITATIONS MENTIONED ABOVE.
    I hope this helps, I've been looking for this solution for quite some time, trying to understand why singed applets work with no policy files for version 1.4... Talk to you later, Jay.

  • Web applet to get pixel color

    I know nothing about java, but I 'll learn if I need. But first, I need to know if a java web applet can do the goal I need:
    A java web applet that can pass a specific pixel color on the browser windows to javascript. The coordinates of that pixel will stay outside the own applet borders.
    I don't know if this is the right forum, so can you please help me in any way?
    Thanks a lot.
    Julio Morales.

    juliochile wrote:
    I know nothing about java, but I 'll learn if I need.
    But first, I need to know if a java web applet can do the goal I need:Fair enough
    A java web applet that can pass a specific pixel color on the browser windows to javascript. Yes this can be done, but as I recall it was somewhat of a pain. It will also be browser-specific. If you ask me the requirement is probably flawed.
    The coordinates of that pixel will stay outside the own applet borders.Huh? So you need to sample a pixel? This post makes little sense. Post the exact use case. Way too vague.

  • Applet can't be instatiated

    I can not run Applet in Internet Browser. It does not work error mesages is "Applet can't be instatiated".
    But it works in appletviewer.

    If you're using Swing in your Applet (i.e. JPanel...etc), you cannot use the browser's default JVM. You must use the Java Plug-In. In order for the browser to know this, you must put a lot of extra information. I suggest you look up the HTML converter on Sun's page. It allows you to run your applet on various browsers. Good luck.

  • Send an email for an Applet....please help ..

    hello guys...
    i have an applet that works much like an HTML form...
    it is a form for products and after having filled that the information has to be updated to the database and the concern people of the company should get an email for the same ....
    how can i send that mail from this Applet... !?!?
    hope someone has some idea about it.. !!!
    please help..

    You should be able to use JavaMail from an applet. The general outline would be the same as from a stand-alone application. However make sure you read the notes (found in %JAVAMAIL_HOME%/NOTES.txt once you install JavaMail) to know about some issues associated with using JavaMail from applets running certain browsers.

  • Awt  V Swing in applets ???

    I've written an applet using Swing but I'm having huge problems trying to get it to run in Internet Explorer (even though it works in the Applet viewer).
    Someone suggested rewriting it using awt so that users with older browsers don't have to download a plugin to be able to view it? Is it necessary to download a plugin to view applets with Swing? Is this better to avoid using packages like Swing if possible, in your opinion? Please let me know what you think - I would like as many people as possible to be able to see the applet on their browsers.
    Thanks for your time.

    It's because of Microsoft and Sun falling out over Java, effectively Microsoft couldn't/wouldn't move beyond 1.1 which was AWT based. At some point in the not too distant future they will remove all Java support so at that point you will be reliant on a plug-in to get to the IE base.
    At the moment, if you've already done some AWT work and the GUI is simple, I'd stick with it, otherwise go to Swing and the plug-in. This is of course subjective, others would disagree strongly with me.
    Answer provided by Friends of the Water Cooler. Please inform forum admin via the 'Discuss the JDC Web Site' forum that off-topic threads should be supported.

  • Java applet availability

    I would like to use an applet on my webpage, but I want to ensure that anyone can view it. Are there any numbers known on how many people can run Java applets from their browsers ? I can't seem to find any good information on it. And for those who can't use applets, what approach should I take in helping them ? Should I redirect to one of the Sun pages with installation instructions ? If you use applets, how do you handle this ? Please, any tips welcome.

    I think most people have Java and a decent web browser nowadays. To make sure, though, that also people without Java can view the Applet, you should add a link to the download page (and instructions).

  • .jar files

    Hi everybody,
    I am pretty new to programming Java and to programming. I understand how to compile .java files to convert them to a .class file and finally running the application. I also understand how applets work, but there's one thing I don't know. BTW I do all my compiling through DOS and typing out all the commands.
    My question is, how do you get those .jar files? I have just read that to run Java applets through web browsers, it is necessary to have this file type. Is there a command available through the DOS prompt Java compiler or do I have to get another IDE? Also, I downloaded my Java IDE from Sun's Java website.
    Thanks for reading, and yes I am that new to programming :)

    The tool is called, unsurprisingly enough, "jar". If you have javac installed, you probably have jar too.
    http://java.sun.com/j2se/1.4.1/docs/tooldocs/windows/jar.html
    You don't have to use jars to deploy applets, but it sure makes it easier.

Maybe you are looking for

  • I can't open my photoshop cs 6 at all, but other programmes are all working fine.

    I'm using a iMac. This is the beginning of the long error message. I've tried uninstalling/reinstalling with no change. Help! I'm in the middle of an important design job. Process:         Adobe Photoshop CS6 [946] Path:            /Applications/Adob

  • Need to double click to activate

    On my mac, in order to activate a link or other object, I need to click twice: once to select, then again to activate. Is there any way to be able to click on something and use it using only one click?

  • JSF 2.0 f:ajax: How to limit what is sent in AJAX request?

    Is there a way in JSF 2.0 with f:ajax (or direct JavaScript equivalent) to limit what parts of a form are sent in AJAX request, like it's counterpart f:ajax render attribute which limits what is returned back from AJAX request. When f:ajax execute at

  • Weblogic Server training

    Could anyone point me in the direction some good self-training resources (books, CBT's, etc.) for Weblogic Server - preferably 8.1? We're getting our feet wet with a third-party app that incorporates Weblogic Server 8.1, but we have no experience wit

  • Cancellation of Invoice for Retun Order

    Hi, the user wants to cancell the invoice against the Return order assuming that the Customer will notreceive it  Can itbe done? Thanks, Jans