Siirry pääsisältöön

2 viestiä tägattu "JavaScript"

Integrating JavaScript with webforJ apps.

Näytä kaikki tagit

Building an Interactive SVG Viewer with webforJ

· 6 minuuttia
Eric Handtke
Software Developer

Building an Interactive SVG Viewer with webforJ

I was building a demo that needed to display an SVG diagram in a webforJ app, and at first I figured it was a straightforward image-loading job. Drop the file on the page, give it a size, done.

Then the real requirements showed up. The diagram was larger than its viewport, so users needed to zoom and pan around it. Its individual sections also represented meaningful things, so the Java app needed to react when a user clicked one. At that point it wasn't really an image anymore, it was an interactive part of the app.

The behavior was self-contained enough to deserve its own component. That turned into SvgViewer, a webforJ composite that displays trusted SVG markup with built-in zoom and pan, and fires a typed Java event with the ID of any region the user clicks.

Creating a webforJ Reading Position Indicator

· 7 minuuttia
Ben Brennan
Technical Writer

cover image

Recently, I was browsing articles on CSS Tricks and came across Reading Position Indicator by Pankaj Parashar. I've seen this type of indicator in articles, blogs, and in lengthy terms and conditions that I've definitely read through thoroughly. I wanted to try recreating a reading position indicator using webforJ, and see if I could build it in less than 100 lines of code.