• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot change SIZE of applet in browser?

 
Sanjit Singh
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.setBackground(Color.white);
contentPane.setLayout(new GridLayout(14,2));
contentPane.add(....);
//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!
Sanjit
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.
Regards,
Manfred.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic