My application will be similar to MS Compiled HTML Help Viewer. On the left side, I will be using JList and on the right side, a JTextPane containing long text files.
I have done upto this, but now, quite confused which component to use for displaying the a Dialog box which will be for searching the words in the displayed text files. I tried JDialog
but with DISPOSE_ON_EXIT.
I select any word to find its next occurence, I just pass it to the JDialog as a global parameter and do the process. After this I close the JDialog. And when the same process is done for another word, the JDialog just doesnt take the new second word, it works with the first word only… What I am doing wrong… ??? Any solution..??? Thanks in advance
EDIT –
This is the code for JDialog with defaultCloseOperation as DISPOSE (NetBeans)-
public class Search extends JDialog
{
public Search(JFrame parent, boolean modal, String sWords)
{
super(parent, modal);
initComponents();
setTitle("Search for - " + sWords);
//Searching procedure
Now when the user copies some text and invokes this form I pass this selected word to the Search JDialog as –
Search s = new Search(parent, true, selectedWord);
I recommend you to use
JOptionPane: