Results 1 to 5 of 5

Thread: JDesktopPane help!

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Resolved JDesktopPane help!

    I decided to start a new project but i haven't coded a gui in a while. I've been trying to use a JDesktopPane but when i create a new instance of it, set it's size then visibility i get nothing .
    Code:
     import java.awt.*; 
     import javax.swing.*; 
     import java.awt.event.*; 
    
     public class Test{
      public static void main(String[] args) {
       JDesktopPane jdp = new JDesktopPane(); 
       jdp.setSize(600,600); 
       jdp.setVisible(true); 
      }
     }

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: JDesktopPane help!

    Are you sure your suppose to set the size and visibiliy of the JDesktopPane?

    I thought it was something like this:

    Code:
       JDesktopPane desktop = new JDesktopPane();
      JInternalFrame iFrame = new JInternalFrame("Frame 1");
      iFrame.setLayout(new BorderLayout());
      iFrame.setSize(300, 300);
      iFrame.setVisible(true);
      desktop.add(iFrame);
    I always added junk to the Pane, and called those methods on the InternalFrame.

  3. #3

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Re: JDesktopPane help!

    Seems i had to add the JDesktopPane to a JFrame.

  4. #4

  5. #5
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: JDesktopPane help!

    Quote Originally Posted by Dilenger4
    Thanks for the help.

    I didn't know I gave any, but your welcome.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width