Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JInternalframe will not maximise on setMaximum(true)

 
Greenhorn
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(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);
 
A berm makes a great wind break. And we all like to break wind once in a while. Like this 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
    Bookmark Topic Watch Topic
  • New Topic