/** Called by the constructor methods to create the default rootPane. */ protected JRootPane createRootPane() { JRootPane rp = new JRootPane(); // NOTE: this uses setOpaque vs LookAndFeel.installProperty as there // is NO reason for the RootPane not to be opaque. For painting to // work the contentPane must be opaque, therefor the RootPane can // also be opaque. rp.setOpaque(true); return rp; }
Component createComponent(Component owner) { Panel component = new MediumWeightComponent(); rootPane = new JRootPane(); // NOTE: this uses setOpaque vs LookAndFeel.installProperty as // there is NO reason for the RootPane not to be opaque. For // painting to work the contentPane must be opaque, therefor the // RootPane can also be opaque. rootPane.setOpaque(true); component.add(rootPane, BorderLayout.CENTER); return component; }
// Override createRootPane() to automatically resize // the frame when contents change protected JRootPane createRootPane() { JRootPane rootPane = new JRootPane(); // { // private boolean packing = false; // // public void validate() { // super.validate(); // if (!packing) { // packing = true; // pack(); // packing = false; // } // } // }; rootPane.setOpaque(true); return rootPane; }
/* * (non-Javadoc) * * @see javax.swing.JFrame#createRootPane() */ @Override protected JRootPane createRootPane() { JRootPane rp = new JRibbonRootPane(); rp.setOpaque(true); return rp; }