import java.awt.*;
import javax.swing.*;
public class image extends JFrame{
JButton b1;
ImageIcon im;
Container c=getContentPane();
public image()
{
im=new ImageIcon("Pictures/sad.jpg");
b1=new JButton(" ",im);
c.setLayout(new FlowLayout());
add(b1);
setSize(500,500);
show();
}
public static void main(String [] args)
{
new image();
}
}
luijean 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.