I only know of ways of getting things like window size if the Window was opened rom a Java® app: you can use these three methods:- 123, or similar. Note those methods are in a supertype of Window; nobody uses Window directly any more.
Not a “beginning” question: moving discussion.
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library