• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

JInternalframe will not maximise on setMaximum(true)

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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(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);
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic