Results 1 to 6 of 6

Thread: JDesktopPane class of java

  1. #1
    Join Date
    Dec 2009
    Posts
    32

    JDesktopPane class of java

    Hello Friends,

    I need your help to solve one of my query related to the advanced java programming. I have very good knowledge about the core java, but class concept of advanced java is very strange for me. I am not getting use of JDesktopPane class of advanced java. I don't any idea about it's constructors also. If you have knowledge about the 'JDesktopPane class', then please let me know the same. I am waiting for your reply.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: JDesktopPane class of java

    Hi,

    A JDesktopPane class is used to create a multiple-document interface or a virtual desktop. You create JInternalFrame objects and add them to the JDesktopPane. JDesktopPane extends JLayeredPane to manage the potentially overlapping internal frames. It also maintains a reference to an instance of DesktopManager that is set by the UI class for the current look and feel (L&F). Note that JDesktopPane does not support borders.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: JDesktopPane class of java

    Hi friend,

    I suggest you to refer following example of java, which will give you some idea about the JDesktopPane class of java:
    Code:
    import javax.swing.JDesktopPane;
    import javax.swing.JLabel;
    
    public class JDesktopPaneDM
     {
      public static void main(final String[] args) {
        JFrame VMX = new JFrame();
        VMX.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
        JDesktopPane desktop1 = new JDesktopPane();
        JInternalFrame internalFrame = new JInternalFrame("Can Do All", true, true, true, true);
    
        desktop1.add(internalFrame);
    
        internalFrame.setBounds(35, 35, 200, 100);
    
        JLabel label1 = new JLabel(internalFrame.getTitle(), JLabel.CENTER);
        internalFrame.add(label1, BorderLayout.CENTER);
    
        internalFrame.setVisible(true);
    
        VMX.add(desktop, BorderLayout.CENTER);
        VMX.setSize(500, 300);
        VMX.setVisible(true);
      }
    }

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: JDesktopPane class of java

    Following are some important methods of JDesktopPane class:
    • setUI(DesktopPaneUI dui)
    • getSelectedFrame()
    • setDesktopManager(DesktopManager dsktMgr)
    • setDragMode(int dragMode1)
    • getAllFramesInLayer(int layer1)
    • getAccessibleContext()

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: JDesktopPane class of java

    If you want to create a JDesktopPane Container by using it's methods , then please go through following java code:
    Code:
    import javax.swing.JDesktopPane;
    
    public class JDesktopMain {
      public static void main(String[] argtv) throws Exception {
        boolean resizable1 = true;
        boolean closeable1 = true;
        boolean maximizable1 = true;
        boolean iconifiable1 = true;
        String title = "Frame Title";
        JInternalFrame iframe0801 = new JInternalFrame(title, resizable1, closeable1, maximizable1,
            iconifiable1);
    
        iframe0801.setSize(300, 300);
        iframe0801.setVisible(true);
        iframe0801.getContentPane().add(new JTextArea());
        JDesktopPane desktop = new JDesktopPane();
        desktop.add(iframe0801);
    
        JFrame frame08 = new JFrame();
        frame08.getContentPane().add(desktop, BorderLayout.CENTER);
        frame08.setSize(400, 300);
        frame08.setVisible(true);
      }
    }

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: JDesktopPane class of java

    Hello Friends,

    There are total six nested class of JDesktopPane class and which mentioned below:
    1. Container.AccessibleAWTContainer
    2. JDesktopPane.AccessibleJDesktopPane
    3. Component.FlipBufferStrategy
    4. JLayeredPane.AccessibleJLayeredPane
    5. Component.AccessibleAWTComponent
    6. JComponent.AccessibleJComponent

Similar Threads

  1. Converting java class to java bean class
    By Ucchal in forum Software Development
    Replies: 6
    Last Post: 09-08-2010, 10:24 AM
  2. KeyboardFocusManager class of java
    By Gokul20 in forum Software Development
    Replies: 4
    Last Post: 05-03-2010, 03:38 PM
  3. JCheckBoxMenuItem class of java
    By Ram Bharose in forum Software Development
    Replies: 5
    Last Post: 18-02-2010, 12:11 PM
  4. What is TransferSupport Class in Java?
    By DANIEL 602 in forum Software Development
    Replies: 4
    Last Post: 13-02-2010, 06:54 AM
  5. Java Programming Language Basics: Reflection Basics and Class Class
    By mayuri_gunjan in forum Guides & Tutorials
    Replies: 6
    Last Post: 29-08-2005, 12:04 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,922,922.48147 seconds with 17 queries