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
Recommended Answers
Jump to Postsome parameters are missing like "set visible="true";
and many others as well, you can try it by using api
All 2 Replies
Reply to this topic
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.