?
Solved

Make an applet fill the browser window

Posted on 2004-09-22
9
Medium Priority
?
241 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 3 hours left to enroll

777 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