Thread View: borland.public.jbuilder.java.swing
2 messages
2 total messages
Started by Raydog
Wed, 31 Mar 2004 05:39
[JBuilderX Foundation] HELP ! to build JDesktopPane
Author: Raydog
Date: Wed, 31 Mar 2004 05:39
Date: Wed, 31 Mar 2004 05:39
10 lines
1127 bytes
1127 bytes
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 ? Thanks so much raydog
Re: [JBuilderX Foundation] HELP ! to build JDesktopPane
Author: 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!!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads