Solved

Make an applet fill the browser window

Posted on 2004-09-22
9
239 Views
Last Modified: 2012-08-14
I have an applet, and I want it to fill all the browser window. To do this, I have this HTML, which works fine (note the 100%):

<applet
  width    = "100%"
  height   = "100%"
  codebase = "."
  code     = "servidor.AppletWrapper.class"
  archive  = "servidor.jar"
  name     = "TestApplet"
>

But, although the applet area of the web page fills the browser window, the actual window inside it, my app's window, does not fill all the area, and I don't know why.
The only thing my applet class does is to crate an instance of a JPanel derived class and add it to itself. This is done in the constructor of the applet:

    MyPanel panel = new MyPanel();
    public AppletWrapper()
    {
        add(panel);
    }

The JPanel derived class contains all the controls, and has BorderLayout.
If you need more info please ask.
0
Comment
Question by:pulupul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 4

Expert Comment

by:funnyveryfunny
ID: 12128104
have a look at this site:
http://www.javaworld.com/javaworld/javatips/jw-javatip80.html

Javascript plays important part here.
0
 
LVL 3

Author Comment

by:pulupul
ID: 12128433
Thanks for the answer, but I'm starting to suspect that the problem has nothing to do with applets or browsers, because I have created an application wrapper for the applet (in order to run it standalone) and I have the same problem, when I maximize the window, the JPanel doesn't fill all of it.
0
 
LVL 3

Author Comment

by:pulupul
ID: 12128543
Forget it, I solved it by using a BorderLayout
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 4

Expert Comment

by:funnyveryfunny
ID: 12128566
try something like this:

 MyPanel panel = new MyPanel();
 
 public AppletWrapper implements ComponentListener()
    {
        add(panel);
        addComponentListener(this);
    }

   public void componentResized(ComponentEvent e){
       panel.resize(this.getWidth(),this.getHeight());
   }

  ...leave other methods empty


0
 
LVL 4

Expert Comment

by:funnyveryfunny
ID: 12128579
ok :)
0
 
LVL 3

Author Comment

by:pulupul
ID: 12132044
It was not an applet or browser issue, as I had first suspected. I solved it by using a BorderLayout layout manager in the JPanel, and putting everything in the center of it. Thanks for your time.
0
 
LVL 4

Expert Comment

by:funnyveryfunny
ID: 12137039
do proceed...no problem
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12155645
Closed, 300 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Setup GlassFish 4 53
program arguments vs VM arguments 4 54
Tomcat 9 + java 8 error while trying to deploy a war file 2 840
Delete .class files at every compile 4 54
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question