Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: What do you think of my CropImage class Date: Thu, 21 Jul 2016 20:35:39 -0400 Organization: A noiseless patient Spider Lines: 43 Message-ID: References: <87twfk93vu.fsf@Equus.decebal.nl> <8737n36ucx.fsf@Equus.decebal.nl> <878twu6i0l.fsf@Equus.decebal.nl> <87vazy4zm2.fsf@Equus.decebal.nl> <87r3am4q2l.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 22 Jul 2016 00:35:52 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="22e5ab429c5a4bb738666b9c52e40d69"; logging-data="22015"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+B9G8zCeiuu/DQSWGiP7K7" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 In-Reply-To: <87r3am4q2l.fsf@Equus.decebal.nl> Cancel-Lock: sha1:xbGSlgsAuAAKiMIj5EgsarXOAqc= Xref: csiph.com comp.lang.java.programmer:35075 On 7/21/2016 5:52 PM, Cecil Westerhof wrote: > On Thursday 21 Jul 2016 21:37 CEST, Eric Sosman wrote: > >> On 7/21/2016 2:25 PM, Cecil Westerhof wrote: >>> [...] >>> I just have one little problem. At the moment I do: >>> crop.setBounds( 10, imageHeight + 10, 80, 30); >>> load.setBounds( 110, imageHeight + 10, 80, 30); >>> imageInfo.setBounds( 10, imageHeight + 50, 500, 30); >>> selectInfo.setBounds(10, imageHeight + 90, 500, 30); >>> setSize(imageWidth + 10, imageHeight + 160); >>> >>> because title and things like that takes room, but I do not know >>> how much. How can I retrieve these values? Then the application >>> looks a little better and I do not have to be afraid it will not be >>> OK on other platforms. >> >> Possibly useful as a starting point: >> >> Dimension screenSize = >> Toolkit.getDefaultToolkit().getScreenSize(); >> >> (Disclaimer: I've only used this on single-screen machines; you need >> to work harder if there are multiple displays.) > > That was not what I mend: I had problems with that it seemed I needed > to set the size greater as the combination of what I put in the frame. > But it could be that I made an error. I need to look into it better. > But this has not the highest priority. Is more icing on the cake. Okay, I may have misinterpreted your need. However, it looks to me as though your difficulty is self-inflicted by your insistence on using absolute positioning. If you used a layout manager instead, you'd just setPreferredSize() on the image-displaying panel (which might well have a null layout manager), and Swing would figure out the dimensions of title bars, menu bars, scroll bars, sand bars, stars and bars, and all the rest. But since you want to use absolute positioning, well, ... (Shrug.) -- esosman@comcast-dot-net.invalid "Don't be afraid of work. Make work afraid of you." -- TLM