Article View: borland.public.jbuilder.java.swing
Article #1109Re: [JBuilderX Foundation] HELP ! to build JDesktopPane
From: pnichols
Date: Wed, 31 Mar 2004 20:10
Date: Wed, 31 Mar 2004 20:10
40 lines
2176 bytes
2176 bytes
Raydog wrote:
> jbX doesn't have JDesktopPane in SwingContainer design, i wonder if anyone
> could
> tell me how to add one ? or i didn't see it some other places?
>
> How do I build a JDesktopPane application with JBuilderX ? only handcode ?
>
What I do usually, using the Designer, is to use a JPanel for the
JDesktopPane. Then in the code, simply change the object itself.
Example
public class MainFrame extends JFrame {
//change the following from JPanel to JDesktopPane.
/*JPanel jdtPane= new JPanel(); --original Code */
/* new code */
JDesktopPane jdtPane= new JDesktopPane();
JMenuBar mnuPanel= new JMenuBar();
JPanel statusPanel= new JPanel();
public MainFrame() {
try{
jbInit();
}
catch(Exception ex) {
ex.printStacktTrace();
}
}
private void jbInit() throws Exception {
this.getContentPane().add(mnuPanel, BorderLayout.NORTH);
this.getContentPane().add(jdtPane, Borderlayout.CENTER);
this.getContentPane().add(statusPanel, BorderLayout.SOUTH);
Notice that I only needed to change the JPanel for jdtPane in one place, the
JPanel jdtPane= new JPanel to JDesktopPane jdtPane= new JDesktopPane().
That will do it for you!!
Technical Details
Message-ID:
<406b2103@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<406a5c6e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,5448ee02950e9956 X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2004-03-31 12:10:33 PST Message-ID: <406b2103@newsgroups.borland.com> From: pnichols <paul@comp.net> Subject: Re: [JBuilderX Foundation] HELP ! to build JDesktopPane Newsgroups: borland.public.jbuilder.java.swing Reply-To: paul@comp.net Mail-Copies-To: paul@comp.net Date: Wed, 31 Mar 2004 15:10:19 -0500 References: <406a5c6e@newsgroups.borland.com> Lines: 43 Organization: clc User-Agent: KNode/0.7.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit NNTP-Posting-Host: 68.71.188.25 X-Trace: newsgroups.borland.com 1080762628 68.71.188.25 (31 Mar 2004 11:50:28 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail