i have class Map in this class I have this method
public void vykresliGraf(Graphics g){
Set set = graf.getUzly().entrySet();
g.setColor(Color.BLUE);
Iterator it = set.iterator();
while(it.hasNext()){
Map.Entry entry = (Map.Entry) it.next();
Uzel u = (Uzel)entry.getValue();
Obec o = (Obec)u.getValue();
g.drawOval(o.getSouradnice().x - 3, o.getSouradnice().y - 3, 6, 6);
g.fillOval(o.getSouradnice().x - 3, o.getSouradnice().y - 3, 6, 6);
}
it = set.iterator();
List<Hrana> pomList = new ArrayList<>();
while(it.hasNext()){
Map.Entry entry = (Map.Entry) it.next();
Uzel u = (Uzel)entry.getValue();
for (int i = 0; i < u.getHranyUzlu().size(); i++) {
Hrana h = (Hrana)u.getHranyUzlu().get(i);
if(!pomList.contains(h)){
pomList.add(h);
Obec o1 = (Obec)h.getZdroj().getValue();
Obec o2 = (Obec)h.getCil().getValue();
g.drawLine(o1.getSouradnice().x, o1.getSouradnice().y, o2.getSouradnice().x, o2.getSouradnice().y);
}
}
}
}
and in my MainFrame class i have method on buttonClick map.vykresliGraf(jPanel1.getGraphics()); and its paint my map on jPanel but when remove some vertex (button click) and call the same map.vykresliGraf(jPanel1.getGraphics()); nothing happened i try repaint(); and still nothing some can help me with this?