• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

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.
Won't you please? Please won't you be my neighbor? - Fred Rogers. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic