I wish Oracle simply included this feature so developers would not have to code it from scratch. However, I came across a custom made class called ScrollFreeTextArea from the javafx-demos website.

This class simply did the trick for me. So whenever you type a long text and it wraps itself or press the ENTER key for a new line, the height of the TextArea increases without displaying the scrollbar.

Here is the complete source code.

One issue I came across while doing one of my projects was to hide the scrollbars of a popup window. Yeah, sure, it is easy if you add the attribute scrollbars=no inside the window.open()‘s window attributes. But what if you wish to hide them when the popup window is already open. Thank you CSS! Yes, it is possible by using Javascript and accessing the window style’s property overflow. However, there is a cross-browser issue. Both IE and Firefox/Google Chrome have different codes that make this work. You can place both their codes in the same page and/or Javascript function. If the browser does not understand the property, it will ignore it anyway so there is no need to do a browser check to execute the code specific to that certain browser.

The code below does the trick

Just in case you wish to disable either just the horizontal or vertical scrollbar, this code works for non IE browsers

Related Posts Plugin for WordPress, Blogger...