2. Programmas kods
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
Graphics g = jPanel1.getGraphics();
int w = jPanel1.getWidth();
int h = jPanel1.getHeight();
int xc = w / 2;
int yc = h / 2;
g.drawLine(0, 0, w, h);
g.drawLine(0, h, w, 0);
g.drawLine(0, yc, w, yc);
g.drawLine(xc, 0, xc, h);
…