I want overlay canvas on progress bar.Please find the below image: I have created a progress bar and i have created a canvas. but i was not getting any info how to overlay canvas on progress bar as shown in image
//program for horizontal progress bar
public class Progress extends JFrame {
// create a frame
static JFrame f;
static JProgressBar b;
public static void main(String[] args) {
f = new JFrame("ProgressBar demo");
JPanel p = new JPanel();
p.setBorder(BorderFactory.createLineBorder(Color.RED));
b = new JProgressBar(SwingConstants.HORIZONTAL);
b.setValue(0);
b.setStringPainted(true);
p.add(b);
f.add(p);
b.add(new SwingDemo());
// set the size of the frame
f.setSize(500, 500);
f.setVisible(true);
}
}
//code for canvas