how to paint images on clicking button in frame?
问题 I've made two buttons in frame .I want to know how to display different images on clicking different buttons? is there another way out or i have to make panel?I am at beginner stage package prac; import java.awt.*; import java.awt.event.*; public class b extends Frame implements ActionListener{ String msg; Button one,two; b() { setSize(1000,500); setVisible(true); setLayout(new FlowLayout(FlowLayout.LEFT)); one=new Button("1"); two=new Button("2"); add(one); add(two); one.addActionListener