Swnig and paint, please HELP! :)

Hi HELP me pleaseI have application with 2 canvases and I need to paint on both canvases at the same time, but I havne no idea how :(can I create 2 my own methods to paint on them?if You have same example codes please paste here :)Thanks a lot :)
[288 byte] By [lama_powera] at [2007-10-3 11:27:05]
# 1
How about you post a sample code that doesn't work and we'll take it from there?
kirillga at 2007-7-15 13:53:06 > top of Java-index,Desktop,Core GUI APIs...
# 2
I have no idea how to od this :(if ia have only one component i override pain method and it's ok but wit two i don't know how do this :(
lama_powera at 2007-7-15 13:53:06 > top of Java-index,Desktop,Core GUI APIs...
# 3

I try this:

import java.awt.Color;

import java.awt.Dimension;

import java.awt.Graphics;

public class Main extends javax.swing.JFrame {

public Main() {

initComponents();

this.kresli(jPanel1.getGraphics());

}

private void initComponents() {

................there all Componentes are initialized.....

}

public void kresli(Graphics g){

g.drawLine(0,0,20,20);

g.setColor(Color.GREEN);

System.out.println("kokot");

}

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Main().setVisible(true);

}

});

}

private javax.swing.JButton jButton1;

private javax.swing.JButton jButton2;

private javax.swing.JPanel jPanel1;

private javax.swing.JScrollPane jScrollPane1;

}

compiler send no error but Panel is clear, with no paints :((((

what's wrong?

lama_powera at 2007-7-15 13:53:06 > top of Java-index,Desktop,Core GUI APIs...