Re: properties JInternalFrame.setMaximum ()
Claude Stéphan <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.general.french |
|---|---|
| Message-ID | <[email protected]> |
Christophe Cailloix a écrit :
> Bonjour,
>
> La méthode setMaximum(boolean b) doit certainement faire appel Ã
> quelques chose que tu initialises après (avec les méthodes
> setXXXXX(new Classe()). Je pense qu'il faudrait que tu mettes ton
> "jInternalFrameBienvenue.setMaximum(true);" dans le champ
> /properties/code/post-init de ton JInternalFrame.
>
> Si je ne suis pas assez clair, n'hésite pas à le dire j'essaierai de
> faire mieux.
>
> A+
>
> Christophe.
>
>
> Claude Stéphan a écrit :
>> Bonjour à toutes et à tous
>>
>> je suis sous windows XP Pro, J2SE5.0 et netbeans 5.0
>>
>> Voici le code d'une application débutante où en l'état actuel des
>> choses, il y a un JFrame qui contient un JDesktopPane lui même
>> contenant un JInternalFrame. Et rien de plus
>>
>> Tel que ce code est écrit, il fonctionne. /*Il faut remarquer que la
>> dimension du JInternalFrame est définie en dehors de la methode
>> initComponents.*/
>> En effet, si j'utilise la proprieté /*setMaximum*/ dans
>> JInternalFrame properties j'obtiens une erreur:
>> /*exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
>> */cette erreur ne se produisant pas si la propriété
>> JInternalFrame.setMaximum est placé à la suite de la méthode
>> initComponents ()/*
>> */
>> Qui pourrait me dire pourquoi?
>>
>> merci
>>
>> claude
>>
>> /*public class Accueil extends javax.swing.JFrame */{
>> /** Creates new form Accueil */
>> /*public Accueil()*/ {
>> initComponents();
>> /* placé à cet endroit, le dimensionnement de
>> JInternalFrameBienvenue est correct et sans erreur*/
>> /* try {
>> jInternalFrameBienvenue.setMaximum(true);
>> } catch (java.beans.PropertyVetoException e1) {
>> e1.printStackTrace();
>> }*/
>> }
>> /** This method is called from within the constructor to
>> * initialize the form.
>> * WARNING: Do NOT modify this code. The content of this method is
>> * always regenerated by the Form Editor.
>> */
>> // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
>> _/*private void initComponents() {*/_
>> jDesktopPane1 = new javax.swing.JDesktopPane();
>> jInternalFrameBienvenue = new javax.swing.JInternalFrame();
>>
>>
>> setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
>> setTitle("Formation Bridge page d'accueil");
>> setIconImage(iconFrameAccueil.IconFrame());
>> setName("frameAccueil");
>> setPreferredSize (dimensionEcran.getDimensionEcran ());
>> jDesktopPane1.setBackground(new java.awt.Color(255, 204, 204));
>> jDesktopPane1.setName("jDesktopPaneGlobal");
>> jInternalFrameBienvenue.setBackground(new java.awt.Color(204,
>> 255, 255));
>> jInternalFrameBienvenue.setMaximizable(true);
>> jInternalFrameBienvenue.setTitle("jInternalFrameBienvenue");
>> / /*place de la propriété JInternalFrameBienvenue.setMaximum(true)
>> qui occasionne l'apparition du message d'erreur*/
>> /
>> /*try {
>> jInternalFrameBienvenue.setMaximum(true);
>> } catch (java.beans.PropertyVetoException e1) {
>> e1.printStackTrace();
>> }*/
>>
>> jInternalFrameBienvenue.setName("jInternalFrameBienvenue");
>> jInternalFrameBienvenue.setPreferredSize(new
>> java.awt.Dimension(0, 0));
>> jInternalFrameBienvenue.setVisible(true);
>> org.jdesktop.layout.GroupLayout jInternalFrameBienvenueLayout =
>> new
>> org.jdesktop.layout.GroupLayout(jInternalFrameBienvenue.getContentPane());
>>
>>
>> jInternalFrameBienvenue.getContentPane().setLayout(jInternalFrameBienvenueLayout);
>>
>> jInternalFrameBienvenueLayout.setHorizontalGroup(
>>
>> jInternalFrameBienvenueLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
>>
>> .add(0, 0, Short.MAX_VALUE)
>> );
>> jInternalFrameBienvenueLayout.setVerticalGroup(
>>
>> jInternalFrameBienvenueLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
>>
>> .add(0, 0, Short.MAX_VALUE)
>> );
>> jInternalFrameBienvenue.setBounds(0, 0, -1, -1);
>> jDesktopPane1.add(jInternalFrameBienvenue,
>> javax.swing.JLayeredPane.DEFAULT_LAYER);
>>
>> org.jdesktop.layout.GroupLayout layout = new
>> org.jdesktop.layout.GroupLayout(getContentPane());
>> getContentPane().setLayout(layout);
>> layout.setHorizontalGroup(
>>
>> layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
>> .add(jDesktopPane1,
>> org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 822, Short.MAX_VALUE)
>> );
>> layout.setVerticalGroup(
>>
>> layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
>> .add(org.jdesktop.layout.GroupLayout.TRAILING,
>> jDesktopPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 511,
>> Short.MAX_VALUE)
>> );
>> pack();
>> }// </editor-fold>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
> ---------------------------------------------------------------------------------------
>
> Wanadoo vous informe que cet e-mail a ete controle par l'anti-virus
> mail. Aucun virus connu a ce jour par nos services n'a ete detecte.
>
>
>
>
merci
claude