Как сделать так, чтобы компонент, созданный во время выполнения, оставался! ?
Good friends and fellow developers, I am making an application in which components with certain characteristics must be created, which allows me to collect certain information to then process it, all this at runtime, in short, that part I am already working on the following shape:
JpnlPunto jpnlComp = new JpnlPunto(index);//new instance to component JpnlContPuntos.add(jpnlComp);//is added to jpanel JpnlContPuntos.validate(); JpnlContPuntos.updateUI(); jpnlComp.setLocation(0, jlblBlock.getY()-45);//component position is established JpnlContPuntos.repaint(); ubiComp.put(String.valueOf(jlblBlock.getY()-45), String.valueOf(i));//the positions of the components created on a map are saved componentes.put(""+index, jpnlComp);//the created component is saved on a map index++; i++;
The components are created perfectly, NOW, my question is how to make these components remain once created, that is, once the application is closed and reopened they are visible where you create them!
Regards, I hope you can help me!
(sorry for my english, use google translator)
Что я уже пробовал:
I was investigating, and I found that by applying the serialization of the components these could be maintained but if someone could explain to me how to do it I would be grateful!