Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Andrew Thompson" Subject: Re: layout problem Message-ID: <74bf4d76c8d7c@uwe> X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: <468d09ce$0$25419$edfadb0f@dread11.news.tele.dk> References: <468d09ce$0$25419$edfadb0f@dread11.news.tele.dk> Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 49 Date: Wed, 27 Apr 2011 15:36:22 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918582 96.60.20.240 (Wed, 27 Apr 2011 10:36:22 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:36:22 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:1965 To: comp.lang.java.gui Simon [2610] wrote: >Hello, >Ive been away from Java development for a little over a year (got job as >.Net programmer) but ive just been handed a Java assignment, so i downloaded >the JBuilder 2007 trial to see if this was going to be my new IDE, but >im having a little trouble doing GUI, i need to create a plugin, and for >that i need to create a JPanel, so i created a JFrame so that i would have >something to launch my JPanel from and be able to see and test the plugin. I >created the JPanel with null layout, ... That is the start of the problems with this GUI. Do not use null layouts, unless defining a layout itself (I.E. calling setLayout(null) from within a LayoutManager/2 implementation). Within that layout, the logic will need to account for the different preferred sizes of components as they might appear under run-time environments that might vary in Java version, screen size and resolution, default font size/family, PLAF, OS.. I highly recommend the layout tutorial. http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html > ...and that worked out very fine, ... I do not find that claim very convincing, given you ended up here. >...but when i created .. A slight change and the 'layout' falls apart? That is to be expected with 'null' layouts, since they are not actual layouts as such - more 'luck and chance'. Do the layout tutorial - it should become more clear. -- Andrew Thompson http://www.athompson.info/andrew/ Message posted via JavaKB.com http://www.javakb.com/Uwe/Forums.aspx/java-gui/200707/1 --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24