How to display an image after mouse cursor point on a text area in Java?
After the mouse cursor point on textarea MSR, MSSR... i need to display an image, after mouse cursor released image dissapear
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.font.TextAttribute;
import java.sql.*;
import java.text.AttributedString;
import java.util.*;
public class Report extends JFrame{
JPanel table = new JPanel();
JPanel process = new JPanel();
JPanel all = new JPanel();
JPanel north = new JPanel();
JPanel south = new JPanel();
JTextField MSR = new JTextField("AAA");
JTextField MSSR = new JTextField("BBB");
JTextField AAR = new JTextField("CCC");
JTextField T10PAR = new JTextField("DDD");
JLabel title = new JLabel("<HTML><u>Types Of Books</u></HTML>");
Font myFont = new Font("Serif", Font.BOLD, 14);
Font myFont1 = new Font("Times New Roman", Font.BOLD , 16);
public Report(){
north.setLayout(new FlowLayout(FlowLayout.LEFT));
north.add(title);
title.setFont(myFont1);
add(north);
table.setLayout( new GridLayout( 4, 1,1,7));
table.add(MSR);
MSR.setHorizontalAlignment(JTextField.CENTER);
MSR.setBackground(Color.WHITE);
MSR.setPreferredSize(new Dimension(218,20));
MSR.setFont(myFont);
MSR.setForeground(Color.BLACK);
MSR.setEditable(false);
table.add(MSSR);
MSSR.setHorizontalAlignment(JTextField.CENTER);
MSSR.setBackground(Color.WHITE);
MSSR.setFont(myFont);
MSSR.setForeground(Color.BLACK);
MSSR.setEditable(false);
table.add(AAR);
AAR.setHorizontalAlignment(JTextField.CENTER);
AAR.setBackground(Color.WHITE);
AAR.setFont(myFont);
AAR.setForeground(Color.BLACK);
AAR.setEditable(false);
table.add(T10PAR);
T10PAR.setHorizontalAlignment(JTextField.CENTER);
T10PAR.setBackground(Color.WHITE);
T10PAR.setFont(myFont);
T10PAR.setForeground(Color.BLACK);
T10PAR.setEditable(false);
add(north,BorderLayout.NORTH);
add(south,BorderLayout.SOUTH);
add(table,BorderLayout.WEST);
add(process,BorderLayout.EAST);
}
public static void main(String[]args){
Report a = new Report();
a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
a.setTitle("Report");
ay.setSize(550,470);
ay.setLocationRelativeTo(null);
a.setVisible(true);
a.setResizable(false);
}
}