IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Agents de placement/Fenêtres Java Discussion :

Contenu JDialog invisible


Sujet :

Agents de placement/Fenêtres Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Février 2006
    Messages
    62
    Détails du profil
    Informations forums :
    Inscription : Février 2006
    Messages : 62
    Par défaut Contenu JDialog invisible
    Bonjour,

    Je fais appel a une classe hérité de JDialog mais le contenu de son panel ne s'affiche pas bien que sa propriété visible soit sur "true".

    Merci d'avance pour votre aide !

    Voici mon code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
     
    package gui;
     
    import javax.swing.JPanel;
    import java.awt.Frame;
    import javax.swing.SpinnerNumberModel;
    import javax.swing.JSpinner;
    import javax.swing.JDialog;
    import javax.swing.JButton;
    import java.awt.Rectangle;
    import javax.swing.JLabel;
     
    public class EditorFrameNew extends JDialog {
     
    	private static final long serialVersionUID = 1L;
     
    	private JPanel jContentPane = null;
     
    	private JButton btnOk = null;
     
    	private JButton btnCancel = null;
     
    	private JLabel lblRow = null;
     
    	private JLabel lblColumns = null;
     
    	private JSpinner spRows = null;
     
    	private JSpinner spColumns = null;
     
    	/**
             * @param owner
             */
    	public EditorFrameNew(Frame owner) {
    		super(owner);
    		initialize();
    	}
     
    	/**
             * This method initializes this
             * 
             * @return void
             */
    	private void initialize() {
    		this.setSize(250, 141);
    		this.setModal(true);
    		setTitle("New map");
    		this.setVisible(true);
    		this.setContentPane(getJContentPane());
    	}
     
    	/**
             * This method initializes jContentPane
             * 
             * @return javax.swing.JPanel
             */
    	private JPanel getJContentPane() {
    		if (jContentPane == null) {
    			lblColumns = new JLabel();
    			lblColumns.setBounds(new Rectangle(15, 38, 123, 19));
    			lblColumns.setText("Number of columns:");
    			lblRow = new JLabel();
    			lblRow.setBounds(new Rectangle(15, 11, 122, 19));
    			lblRow.setText("Number of rows:");
    			jContentPane = new JPanel();
    			jContentPane.setLayout(null);
    			jContentPane.add(getBtnOk(), null);
    			jContentPane.add(getBtnCancel(), null);
    			jContentPane.add(lblRow, null);
    			jContentPane.add(lblColumns, null);
    			jContentPane.add(getSpRows(), null);
    			jContentPane.add(getSpColumns(), null);
    		}
    		return jContentPane;
    	}
     
    	/**
             * This method initializes btnOk        
             *      
             * @return javax.swing.JButton  
             */
    	private JButton getBtnOk() {
    		if (btnOk == null) {
    			btnOk = new JButton();
    			btnOk.setBounds(new Rectangle(26, 67, 81, 29));
    			btnOk.setText("Create");
    			btnOk.addActionListener(new java.awt.event.ActionListener() {
    				public void actionPerformed(java.awt.event.ActionEvent e) {
    					System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
    				}
    			});
    		}
    		return btnOk;
    	}
     
    	/**
             * This method initializes btnCancel    
             *      
             * @return javax.swing.JButton  
             */
    	private JButton getBtnCancel() {
    		if (btnCancel == null) {
    			btnCancel = new JButton();
    			btnCancel.setBounds(new Rectangle(133, 67, 81, 29));
    			btnCancel.setText("Cancel");
    			btnCancel.addActionListener(new java.awt.event.ActionListener() {
    				public void actionPerformed(java.awt.event.ActionEvent e) {
    					System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
    				}
    			});
    		}
    		return btnCancel;
    	}
     
    	/**
             * This method initializes spRows       
             *      
             * @return javax.swing.JTextField       
             */
    	private JSpinner getSpRows() {
    		if (spRows == null) {
    			spRows=new JSpinner(new SpinnerNumberModel(0, 0, 10,1));
    			spRows.setEditor(new JSpinner.NumberEditor(spRows, "0"));
    			spRows.setBounds(new Rectangle(167, 11, 59, 19));
    		}
    		return spRows;
    	}
     
    	/**
             * This method initializes spColumns    
             *      
             * @return javax.swing.JTextField       
             */
    	private JSpinner getSpColumns() {
    		if (spColumns == null) {
    			spColumns=new JSpinner(new SpinnerNumberModel(0, 0, 10,1));
    			spColumns.setEditor(new JSpinner.NumberEditor(spColumns, "0"));
    			spColumns.setBounds(new Rectangle(167, 38, 59, 19));
    		}
    		return spColumns;
    	}
     
    }  //  @jve:decl-index=0:visual-constraint="10,10"

  2. #2
    Membre Expert Avatar de herve91
    Profil pro
    Inscrit en
    Novembre 2004
    Messages
    1 282
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2004
    Messages : 1 282
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    this.setContentPane(getJContentPane());
    this.setVisible(true);

  3. #3
    Membre confirmé
    Inscrit en
    Février 2006
    Messages
    62
    Détails du profil
    Informations forums :
    Inscription : Février 2006
    Messages : 62
    Par défaut
    Merci pour cette réponse rapide !
    C'est quand meme bizzare que l'ordre d'initialisation des attribut importe même apres un rafraichissmeent des composant ...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Contenu variable invisible avec var_dump
    Par Manuxy dans le forum Langage
    Réponses: 5
    Dernier message: 05/09/2013, 18h11
  2. JDialog contenu invisible sous windows
    Par xp20009895me dans le forum Agents de placement/Fenêtres
    Réponses: 0
    Dernier message: 06/01/2013, 01h22
  3. Réponses: 2
    Dernier message: 28/02/2007, 20h57
  4. Rendre invisible le contenu d'un TabSheet
    Par tomy29 dans le forum Delphi
    Réponses: 5
    Dernier message: 08/02/2007, 15h43
  5. Bug contenu d'une zone de texte invisible
    Par Aerofly dans le forum Access
    Réponses: 5
    Dernier message: 13/12/2006, 15h27

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo