Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Make an applet fill the browser window

Posted on 2004-09-22
9
Medium Priority
?
242 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

610 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