Image Swing Java source code
#1

Code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ImageSwing extends JFrame
{
    public static int width=300;
    public static int height=300;
    public Icon b1 = new ImageIcon("001.bmp");
    public Icon b2 = new ImageIcon("002.bmp");
    public ImageSwing(String lab)
    {
        super(lab);
        JButton top = new JButton("First",b1);
        top.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
               System.out.println("Top");
            }
        });
        JButton bottom = new JButton("Second",b2);
        bottom.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                 System.out.println("Bottom");
            }
        });
        top.setMnemonic(KeyEvent.VK_F);
        bottom.setMnemonic(KeyEvent.VK_S);
        Container Content = getContentPane();    
        Content.setLayout(new GridLayout(2,2));
        Content.add(top);    
        Content.add(bottom);
    }
    
    public static void main(String args[])
    {
        
        ImageSwing f1=new ImageSwing("Images");
        f1.addWindowListener(new WindowAdapter()
        {
           public void windowClosing(WindowEvent e)

            {
                System.exit(0);
            }
        });

    f1.setSize(width,height);
    f1.show();
}
}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: source code inventory management system java swing, java swing projects code and synopsis, v1 video swing, source code for energy billing system in swing, java swing banking project, swing power generarter, registration from in swing java,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Simple Key Events Java source code smart paper boy 3 3,554 07-02-2017, 03:41 PM
Last Post: NARESHLAFOOT
  Window Events Java source code smart paper boy 1 3,638 02-03-2012, 10:48 AM
Last Post: seminar paper
  Inter net banking java source code smart paper boy 3 5,905 01-03-2012, 11:24 AM
Last Post: seminar paper
  UDP server java source code smart paper boy 1 3,783 05-01-2012, 05:50 PM
Last Post: jeslinapeter
  UDP client Java source code smart paper boy 2 3,638 12-12-2011, 09:56 AM
Last Post: seminar addict
  Text Demo Java source code smart paper boy 0 2,054 30-08-2011, 12:44 PM
Last Post: smart paper boy
  Text Area Demo Java source code smart paper boy 0 2,057 30-08-2011, 12:44 PM
Last Post: smart paper boy
  Servlet Database Java source code smart paper boy 0 2,435 30-08-2011, 12:42 PM
Last Post: smart paper boy
  server test Java source code smart paper boy 0 2,246 30-08-2011, 12:42 PM
Last Post: smart paper boy
  Ser To App java source code smart paper boy 0 1,658 30-08-2011, 12:39 PM
Last Post: smart paper boy

Forum Jump: