Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: JFrame stays unusably small in applet Date: Sun, 06 Nov 2011 07:13:47 -0800 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: <67qcb7dpu8cobr0ip32pagie2nf5v3nb68@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 6 Nov 2011 15:13:49 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="4427"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19wFHPh4gNfZi3r8h804oSc/OnmaxE4d4E=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: Cancel-Lock: sha1:TwPWjMsR2U3CT8uxOF67xtLas4M= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9657 On 11/6/2011 5:22 AM, Thomas Richter wrote: > There is absolutely no layout within at all. All I do is to get the > graphics and render some text. I do not call "pack" - there is beyond > the text output nothing else that happens there... > > Are there any known settings in firefox or windows or java that would > prevent JFrames from opening the indicated size (yes, the size does fit > onto the monitor of the customer, checked that). Oh... yes, I think there are. FireFox itself can call various methods on the applet to resize it. Even if you don't normally see it, I'd assume that the applet is calling some public methods (like pack()) to try to resize the window. With no layout, the JFrame might become confused and assume it has a size of "0,0". That would sure explain the behavior you are seeing. Can you modify the JFrame to have a layout, and add a subcomponent that's fixed to the size you want? The normal way to do this is to make a JPanel subclass, and then to override the JPanel::getPreferredSize() method to always return the size you want. Within the JPanel you can use any absolute layout you want.