Welcome to JFrame & JLabel Images
Would you like to make this site your homepage? It's fast and easy...
Yes, Please make this my home page!
/*
Author:ZT
Date : Aug 13,2017
Purpose: Developing Java Application for ITC
Reference : Java 2 SE
*/
// package a.b.c;
import static java.lang.System.out;
import javax.swing.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.*;
public class Appl08132017h extends JFrame implements ActionListener{
static String welmsg="Welcome to java technology 2017";
JTextArea a1;
Appl08132017h(){
super("ITC Application ");
setSize(600,600);
setDefaultCloseOperation(EXIT_ON_CLOSE);
Container p1= getContentPane();
setLayout(new BorderLayout());
// JPanel p1=new JPanel(new BorderLayout());
a1=new JTextArea(20,20);
a1.setText("Write Your Comments ");
p1.add(a1,BorderLayout.CENTER);
JButton b1=new JButton("submit");
b1.addActionListener(this);
p1.add(b1,BorderLayout.NORTH);
ImageIcon imgThisImg = new ImageIcon("d:\\java2017\\p1.jpg");
JLabel lb1=new JLabel();
lb1.setIcon(imgThisImg);
p1.add(lb1,BorderLayout.SOUTH);
JLabel lb2=new JLabel("dm");
p1.add(lb2,BorderLayout.EAST);
} // constrcuctor
public static void main(String args[]){
// out.println(welmsg);
new Appl08132017h().setVisible(true);
} // end of main() method
public void actionPerformed(ActionEvent e){
String str1=e.getActionCommand();
if(str1.equalsIgnoreCase("submit")) {
// JOptionPane.showMessageDialog(null,str1);
a1.setText("Write Your Comments ");
}
} // end of actionPerformed(0 method
} // end of class App08132017h