Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Cannot change SIZE of applet in browser?

Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem and I would be grateful if somebody could help me out. I have an applet that uses the grid layout and it displays properly if run with applet viewer, but when I embed this applet in my html file, then the display is not fine and everything is shown cramped up.
my applet code is as follows (general idea):
public class InsideMarketApplet extends JApplet {
//declarations of variables and components
public void init() {
Container contentPane = getContentPane();
contentPane.setLayout(new GridLayout(14,2));
//add all the components} and so on...

My HTML file is as follows:
<APPLET WIDTH=500 HEIGHT=400 CODE="InsideMarketApplet.class" CODEBASE="." NAME = "InsideMarketApplet"> </XMP>
//parameters </APPLET>
In the above scenario, if I even change the width and height attributes with my applet tag, still nothing happens and the applet is shown cramped up. I dont understand why this is happening.
I want the applet size to be bigger so that everything doesnt looked cramped up, but somehow changing the attributes od widthand height is not helping at all. What is the problem and how can I achieve what I want?
Thanks in advance!
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There must be something wrong with your APPLET HTML tag. If you change the WIDTH and/or HEIGHT tags then the applet should resize upon restarting.
NOTE: If you are using the Sun plug-in you must use either the EMBED (Netscape) or OBJECT (IE) tags.
You get good luck from rubbing the belly of a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic