Solved

Maximizing & Minimizing HTML

Posted on 1997-08-04
2
359 Views
Last Modified: 2012-05-05
I'm programming two applets that are comunicating data and now I'm
interested in maximize the applet that has the focus and minimize the
other.

The problem are that the HTML page gives a fixed size to every applet and I
can't modify.

I've tried hiding the applet but it doesn't works.


TIA




0
Comment
Question by:scc080497
2 Comments
 
LVL 1

Expert Comment

by:katya062697
ID: 1224425
There is no way to minimize an applet, since the applet's area is *always* fixed by the height and width parameters of the surrounding html page. This is a very unfortunate limitation.

The only thing you can do is to override the gotFocus() and lostFocus() methods of the applet, and then do something to show that the applet is active/inactive. You could, for instance, do a removeAll() (which removes all components) or something similar to clear the area of the inactive applet, and if you applet has the same background as the surrounding page if would just look as an empty space.

Unfortunately, hide() does not work on top level objects (applet).
Probably not what you wanted to hear, but I think this is the best that can be done. Sorry
0
 
LVL 4

Accepted Solution

by:
rembo earned 100 total points
ID: 1224426


There are two things that you can try that are really tricks.  

The first would be to size the applet to the maximum size that
you might want it to be.  Then place a panel inside the applet
that you do a resize on.  The other is to use a CardLayout and
to have differennt size panels in the different cards.  

Just a couple of suggestions.

-Tony

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now