0

I´ve already searched for related posts on stack, but didn´t find quite the right answer; Im using THIS to display a .pdf file in my frame.

Now I want to use the JWebBrowser.navigate()+ (filePath + "#search=anyString") to search this .pdf file for the specific string. Unfortunately I´m unable to reload the JWebBrowser afterwards. So the correct filepath is submitted (checked that in the pdf adress bar), but the JWebBrowser turns gray and nothing happens.

When using the navigate() to load another file and afterwards navigate to the old file again, it works just fine.

I tried revalidate(), repaint() and stuff like this but I cant get this to work.

Example:

btnTest.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                browser.navigate(filePath + "#search=flower");
                browser.revalidate();
                browser.repaint();
            }
        });

I appreciate any kind of advice!

Thanks!

Community
  • 1
  • 1
Slajoc
  • 59
  • 1
  • 8

1 Answers1

0

meanwhile I've found a solution, although it might be not the perfect one:

You can just remove the JWebbrowser object from your current Frame/Panel and just add it again. This way it will work just fine.

Just in case someone is having a related problem to this one.

Greetz

Slajoc
  • 59
  • 1
  • 8