Results 1 to 6 of 6
  1. #1
    t500yo is offline Member
    Join Date
    Jun 2010
    Posts
    14
    Rep Power
    0

    Default JDesktopPane Design

    Hello everyone,
    I'm designing a window using a JFrame and I added a JDesktopPane. I love the JDesktopPane and working with JInternalFrames, but I have some issues with it. I can add a JInternalFrame when using the standard Layout, but when I change the layout to BorderLayout and add a new Component (eg. JSplitPane to the west) I can't add new JInternalFrames to the JDesktopPane.PALETTE_LAYER.

    Also, I want the lower bar, to which you can minimize, be invisible when there is nothing minimized or available and when it is visible, change it's borders (no border). Maby even move it outside the JDesktopPane. Is this possible?
    I have searched the source code of JInternalFrame, JDesktopPane, SynthDesktopPaneUI, DesktopPaneUI, etc. but can't find anything helpfull)

    Thank you in advance!

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  3. #3
    t500yo is offline Member
    Join Date
    Jun 2010
    Posts
    14
    Rep Power
    0

    Default

    Hello Eranga,
    Thank you for your reply.
    What I like to do is to restyle (a new paint) the lower bar (to which you can minimize and see every available JInternalFrame) so that this component does not have any borders and will not be visible when there are no JInternalFrames (anymore) in the JDesktopPane (if possible).
    Thank you in advance!

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  6. #6
    t500yo is offline Member
    Join Date
    Jun 2010
    Posts
    14
    Rep Power
    0

    Default

    Thank you again Eranga,
    for those of you who still dont understand my question (I think I did describe it poorly (Denglish?)): try http://img717.imageshack.us/img717/262/screenshotwe.png
    My cursor is on the JInternalFrame, which is in the JDesktopPane. Under the JInternalFrame (window within the window) you'll find the panel I would like to restyle. I now think it is called a taskbar and is located above the statusbar(the BorderLayout.SOUTH in the main JFrame), with the arrow pointing to it.

    My Code:
    Java Code:
    private Container createContentPane() {
    		contentPane.add(ToolBar,BorderLayout.NORTH);
    		contentPane.add(SideBar,BorderLayout.WEST);
    		JDesktopPane DeskTop = new JDesktopPane();
    		contentPane.add(DeskTop,BorderLayout.CENTER);
    		contentPane.add(Status, BorderLayout.SOUTH);
    		
    		JInternalFrame palette = new JInternalFrame("Palette", true, true, true, true);
    	    palette.setBounds(350, 150, 100, 100);
    	    palette.putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);
    	    DeskTop.add(palette, JDesktopPane.PALETTE_LAYER);
    	    JTextArea ta = new JTextArea();
    	    palette.getContentPane().add(new JScrollPane(ta));
    	    palette.setVisible(true);
    	    
    	    for (int i = DeskTop.getComponentCount()-1; i >= 0; i--){
    	    	ta.setText(ta.getText()+i+'\n'+DeskTop.getComponent(i).toString()+"\n\n");
    	    }
    		return contentPane;
    	}
    So I basically did nothing important, only add a JInternalPane to the JDesktopPane.

Similar Threads

  1. Dispose a JDesktopPane for logout.
    By hendrix79 in forum New To Java
    Replies: 3
    Last Post: 02-10-2009, 04:09 PM
  2. JDesktoppane?
    By skatefreak in forum New To Java
    Replies: 2
    Last Post: 01-31-2009, 06:32 PM
  3. How to clear JDesktopPane
    By hendrix79 in forum New To Java
    Replies: 12
    Last Post: 12-11-2008, 12:25 AM
  4. JDesktopPane demo
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-26-2008, 08:43 PM
  5. How to add SystemTray to JDesktopPane
    By elisabethkron@yahoo.co.uk in forum Advanced Java
    Replies: 0
    Last Post: 04-07-2008, 09:37 PM

Tags for this Thread

Posting Permissions

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