PLEASE, HELP!

Hello people!
Would be very grateful to anybody who can help me with this:
Say, I created a web page in java (with HTMLWriter)and I want it to go
to the system tray when I click the “close” button of the page and of
course to have it restored after I click the icon in the tray.
Is it possible to do it in Java and if it is how then I can do it?

Please, help! ???

What is displaying your web page?

What JRE are you using? The Mustang betas have system tray support. The JDIC project on java.net has system tray stuff that you can use now on released JREs.

Hello! I’m describing in detail what I want to do.
I’m using JDK1.5.
Say, with the aid of the HTMLWriter I created a web page and then displayed it on the desktop.
All I want this page to do is to go to the system tray when I close it and of course have it restored after
clicking the icon in the tray (just like NAV, say).
I tried JDIC. It just creates icons and removes them, but I want the icon to somehow “remember” the page
and dont want to recreate it each time the user clicks the icon in the tray. That’s all.

Display it with what? A browser? Your Java program?

By “page” you mean the program window displaying the page, I assume. Which is why I asked how you were displaying the HTML that you have generated.

I think you can do all of that through the system tray support in JDIC. Assuming it is your own Java program that is rendering the HTML, your program can remember the page and simply hide/show the window based on clicks on the system tray icon.

Hello! I mean the page is displayed by my program.
Let it be a page generated by a servlet.
Or just a page created with HTMLWriter and then executed
with Runtime.getRuntime().exec("…");
In a word is there a Java API that allows to
handle a web page just like a Frame or JFrame
(I basically need desposing, hiding , showing and events like
minimize button clicked, maximize button clicked, close button(“X”)
clicked)?
Thank you!

JFrame with a JEditorPane in it…

http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JEditorPane.html

Kev

JEditorPane doesnt look much like the browser window.
I need an API that lets do smth like this.
WebPage webPage = new WebPage(“anything”);
webPage.show(); // methods like hide(), dispose() would not do harm
and to be able to catch events on minimizing, maximizing and closeing the window.
In a word I need an API that lets to create a WebPage, display it and control the content.
Any suggestions?
Thank you!

That are several Problems at once.

I would suggest learning some more about Java Swing, Frames/Windows and the AWT-Event-System
http://java.sun.com/docs/books/tutorial/uiswing/events/windowlistener.html

and then trying to use the JDIC tray functionality with a JFrame containing a “Hello World” JLabel.

After you have the tray working with all your needed features (close,minimize,maximize,tray context menu, etc.) you can exchange the JLabel with an JEditorPane to display a simple webpage and implement the state handling (e.g. remembering the page, etc.)

If you have this working, you can try to integrate the JDIC webbrowser component:
https://jdic.dev.java.net/nonav/documentation/javadoc/jdic/org/jdesktop/jdic/browser/WebBrowser.html

Since I have no knowledge about the state of the JDIC component, it might give better results to integrate the xhtml browser “flying saucer” instead:
https://xhtmlrenderer.dev.java.net/

If you are still not satisfied with the html rendering, you can embed mozilla via JRex:
http://jrex.mozdev.org/

To embed the Internet Explorer, you have to use the OLE/COM component under Windows. There is a software available (e.g. NewJawin) to allow this:
http://shareware.pcmag.com/product.php?id=60701&SiteID=pcmag

I strongly suggest to follow these steps in this order and stop at integrating “flying saucer” :wink: Everything else might take a very long time to get working…

I have used JDIC and it allows you to put an Icon in the TaskBar and to minimize to that icon, but your program is still running, so you could have it so that clicking on the minimize button just did a currentFrame.setVisible(false); and then clicking on the icon in the task bar did a currentFrame.setvisible(true);, then it would never forget what page it was looking at!

But you cannt access the system tray through an aaplet, can you?
And even signing will not help here, right?

I now that I bore you but I promise that I wil not be walking in this forum any more if you tell me one more thing.
I need a Report Generator with which I can create reports in Java and manipulate the page format and size,
put graphical elements, handle row numbers per sheet etc. Ha?

That must be a pretty boring game, that you are developing :wink: