public class monPanel extends JPanel {
private JFormattedTextField jft;
private JPanel monPanelBis
public monPanel() {
super(new BorderLayout());
...
}
public void open(){
try{
MaskFormatter maskCount = new MaskFormatter("#");
jft = new JFormattedTextField(maskCount);
}catch(ParseException evt){
evt.printStackTrace();
}
......
this.buildMonPanelBis();
.....
this.add(monPanelBis,BorderLayout.CENTER);
}
private void buildMonPanelBis() {
monPanelBis = new JPanel(new GridLayout(1,5,6,6));
jft.setText("9");
monPanelBis.add(jft);
....
}
}
Partager