Cannot change "Size" of Applet in Browser?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sanjit_Singh
Posted On:   Friday, November 16, 2001 07:05 AM

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}    More>>

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:




//parameters




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

   <<Less

Re: Cannot change "Size" of Applet in Browser?

Posted By:   sam_pitroda  
Posted On:   Monday, November 26, 2001 03:53 PM

I think the correct way is to use OBJECT and EMBED tags instead of applet tag.

Re: Cannot change "Size" of Applet in Browser?

Posted By:   P_Nagappan  
Posted On:   Sunday, November 18, 2001 06:40 PM

Hi,

If you want only the Applet to appear

in the browser, specify the size in

terms of percentage i.e. WIDTH=100% and

HEIGHT=100%.



Regards

Nagappan
About | Sitemap | Contact