Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JInternalframe will not maximise on setMaximum(true)  RSS feed

Scott Buckham
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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( 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.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)));
// 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());
// Add the tool bar, status bar, holderP to the application shell
container.add(holderP, BorderLayout.CENTER);
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!