i have a jlable.and i'm going to draw a graph on it.but i realized that a line crated by draw line method ,disappear when resizing frame.
this is my code.i want to know how to avoid from disappearing when resize.i want to stay line even resize jframe.
void graph(JComponent jcom,int thick,int height,int xpos,int ypos,Color col){
Graphics2D gfx=(Graphics2D) jcom.getGraphics();
gfx.setStroke(new BasicStroke(thick));
gfx.setPaint(col);
gfx.drawLine(xpos, ypos, xpos, ypos-height);
}
button click code
graph(jLabel1, 10, 100, 200, 200, Color.GREEN);