aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JInternalframe will not maximise on setMaximum(true) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JInternalframe will not maximise on setMaximum(true)" Watch "JInternalframe will not maximise on setMaximum(true)" New topic
Author

JInternalframe will not maximise on setMaximum(true)

Scott Buckham
Greenhorn

Joined: Apr 14, 2003
Posts: 2
I am creating a JInternal frame and adding it to a desktopPane and adding the desktopPane to the JSplitterPane. I am getting java.lang.NullPointerException at javax.swing.DefaultDesktopManager.maximizeFrame(DefaultDesktopManager.java:90) where it is tryign to getParent().getBounds() on the internalframe. I have done some testing an the internalframe never gets assigned a parent (put it on a listener for minimize so that it was after construction to be shore).
Could anyone help me??? Thanks in advance
Here is a summary of the code:
navigatorFrame = new JInternalFrame("Task Bar", true, true, true, true);
navigatorFrame.addInternalFrameListener(new InternListener());
navigatorFrame.setSize(new Dimension(250,this.getSize().height - 110));
// Add the navigation bar to the navigator panel
navigatorFrame.getContentPane().add(navBar);
navigatorFrame.setResizable(false);
navigatorFrame.setVisible(true);
navigatorFrame.setFrameIcon(new ImageIcon(""));
// Create the display frame that displays the main contents
JDesktopPane desktopPane = new JDesktopPane();
navigatorFrame = (JInternalFrame) desktopPane.add(navigatorFrame);
// Create the split pane
JSplitPane splitPane = new JSplitPane();
splitPane.setBorder(new EmptyBorder(new Insets(0,0,0,0)));
splitPane.setDividerLocation(250);
splitPane.setOneTouchExpandable(true);
// Add the internal frames to the split pane
splitPane.add(JSplitPane.LEFT, desktopPane);
// Create the holder panel and add our Intenal frames to the holder
holderP = new JPanel();
holderP.setLayout(new GridLayout());
holderP.add(splitPane);
// Add the tool bar, status bar, holderP to the application shell
container.add(holderP, BorderLayout.CENTER);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JInternalframe will not maximise on setMaximum(true)