
sir" HOW TO DISPLAY TEXT FIELD IN A BACKGROUND IMAGE AT THE RUN TIME EITHER USING SWING OR APPLET IN JAVA BUT NOT AS JAVA SCRIPT"
Thanks sowmiya.R

Here is a java swing code that displays background image.
import java.awt.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
import javax.swing.*;
public class BackgroundImage{
private BufferedImage image;
private JPanel panel = new JPanel(new GridLayout(4,2)) {
protected void paintComponent(Graphics g){
super.paintComponent(g);
if (image != null){
g.drawImage(image, 0, 0, this);
}
}
};
public BackgroundImage(){
try{
File file=new File("C:\\rose.jpg");
image = ImageIO.read(file);
Dimension imageSize = new Dimension(image.getWidth(), image.getHeight());
panel.setPreferredSize(imageSize);
JLabel label1=new JLabel("Username: ");
JLabel label2=new JLabel("Password: ");
JTextField text1=new JTextField(10);
JTextField text2=new JTextField(10);
JButton b1=new JButton("Login");
panel.add(label1);
panel.add(text1);
panel.add(label2);
panel.add(text2);
panel.add(b1);
}
catch (Exception e){}
}
public JPanel getPanel(){
return panel;
}
public static void main(String[] args) {
JFrame frame = new JFrame("BackgroundImage ");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new BackgroundImage().getPanel());
frame.setSize(300,150);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}

You can also visit the following link:
http://www.roseindia.net/tutorial/java/swing/transparentImage.html

thanks sir
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.