🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2881

Frame sizing problem

#2881
From: Charles Johnson
Date: Mon, 05 Jul 1999 00:00
40 lines
2371 bytes
Perhaps someone can help me show a frame of the correct width?
A brief description of the applet GUI:
I have a frame that contains a scroll pane that contains a panel that
contains several choices.
The object of the exercise is to show the frame wide enough to make the
thumbnails on the choices visible when the user presses a button.
The following code works well when the applet is running in Appletviewer in
JBuilder2:

guiFrame.setSize(setFullWidth());//calling below
guiFrame.validate();

  private Dimension setFullWidth() {
    /* need new variable as reference to scrollPanePanel.getPreferredSize()
is const*/
    Dimension d = new Dimension(scrollPanePanel.getPreferredSize());
   /* ensure, if there are only two or three questions, that the window
height is  not decreased */
    int guiFrameHeight = guiFrame.getPreferredSize().height;
    if (d.height < guiFrameHeight) { d.height = guiFrameHeight; }
    d.width += 2 * (
                    scrollPane.getInsets().right +
                    scrollPanePanel.getInsets().right +
                    guiFrame.getInsets().right
                    );
    return d;
  }

But when the applet is loaded over the web as you will see if you go to
http://www.sigma-software.freeserve.co.uk and click on the quiz link, the
frame is not wide enough to enable the thumbnails of the choices to be seen.
The reason is that the scrollPane insets are zero when  running in IE5! I've
tried a few validation calls without success.
Any suggestions? Perhaps there is a better way of doing this?

--
Charles Johnson

Reply to cehjohnson@ANTISPAMsigma-software.freeserve.co.uk
(Remove ANTISPAM when replying)
Technical Details
Message-ID: <7lqg7o$u3g$1@news7.svr.pol.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,54ad9e7fbaa4d602,start
X-Google-Attributes: gid1089d0,public
From: "Charles Johnson" <cehjohnson@ANTISPAMsigma-software.freeserve.co.uk>
Subject: Frame sizing problem
Date: 1999/07/05
Message-ID: <7lqg7o$u3g$1@news7.svr.pol.co.uk>
X-Deja-AN: 497385437
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
X-Complaints-To: abuse@theplanet.net
X-Trace: news7.svr.pol.co.uk 931185720 30832 62.136.59.119 (5 Jul 1999 14:42:00 GMT)
Organization: Customer of Planet Online
X-MSMail-Priority: Normal
NNTP-Posting-Date: 5 Jul 1999 14:42:00 GMT
Newsgroups: borland.public.jbuilder.java.api