HTMLExecutable - start at top of panel when lots of info

Ask questions and discuss programming issues around Tatool Java.
Locked
StoneJ
Posts: 50
Joined: Thu Aug 29, 2013 10:39 am
Institution: University of Lancaster, UK

HTMLExecutable - start at top of panel when lots of info

Post by StoneJ » Fri Jan 24, 2014 6:09 pm

Hi,

I was wondering if anyone can help me with a small matter.

When the HTML executable shows the information from a html page, if that information doesn't fit on the screen it goes into a JScrollPane which is exactly what I want. But the problem is that when tatool opens up the executable it defaults to showing the page with the scroll bar at the very bottom of the page as opposed to the top of the page which would be more natural.

This seems trivial but in my experience there will be a number of participants who do not realise this and don't manually scroll up to the see initial information. I don't want to seperate the information onto multiple pages because depending on monitor size there will be too much/too little on each resulting in problems either way.

This strikes me as odd, I would think that the default behaviour would be to start at the top of the scroll bar. Can anyone offer any advice to make this so?

Thanks,


James

alocher
Posts: 259
Joined: Tue Apr 24, 2012 12:56 pm
Institution: Tatool

Re: HTMLExecutable - start at top of panel when lots of info

Post by alocher » Sun Jan 26, 2014 3:36 am

Hi James, you're absolutely right. Whenever the screen first shows your page it should start at the top. I've added this as a fix to the next release of Tatool. You can also add this fix to your own project right now as you probably can't wait for the next release.

In order to do so you'll need to add the attached class files to your own project (change the package names in order to fit your project structure). The only thing left to do is to use the HTMLExecutable of your own project instead of the general one in your module file.

Replace ch.tatool.core.executable.HTMLExecutable with [package structure where you put your HTML Executable].HTMLExecutable

Hope that helps!

Cheers,
André
You do not have the required permissions to view the files attached to this post.

StoneJ
Posts: 50
Joined: Thu Aug 29, 2013 10:39 am
Institution: University of Lancaster, UK

Re: HTMLExecutable - start at top of panel when lots of info

Post by StoneJ » Sun Jan 26, 2014 6:57 am

Hi André,

Thanks for the quick fix, much appreciated it worked perfectly.

Out of curiosity, is it this method that sets where the page starts:

Code: Select all

jEditorPane.setCaretPosition(0);
Thanks again,


James

alocher
Posts: 259
Joined: Tue Apr 24, 2012 12:56 pm
Institution: Tatool

Re: HTMLExecutable - start at top of panel when lots of info

Post by alocher » Sun Jan 26, 2014 7:10 am

Exactly, as the editorPane is a "text object" you can simply move the caret to the start position to initiate the scrolling.

StoneJ
Posts: 50
Joined: Thu Aug 29, 2013 10:39 am
Institution: University of Lancaster, UK

Re: HTMLExecutable - start at top of panel when lots of info

Post by StoneJ » Sun Jan 26, 2014 8:12 am

alocher wrote:Exactly, as the editorPane is a "text object" you can simply move the caret to the start position to initiate the scrolling.
Thanks for the info!

Locked

Who is online

Users browsing this forum: No registered users and 1 guest