Member-only story
Bootstrap and GWT Transpiler — Just Flowers
This is a brief story of my experience utilizing #Bootstrap and #GWT transpiler to convert #Java to #JavaScript for building a simple interactive web app.
While brainstorming ideas for the web app can be time-consuming, I’ve found that implementing them into a small web app is relatively straightforward nowadays. Leveraging my familiarity with Java, I employed the current #Bootstrap framework and the #GWT transpiler to convert Java to JavaScript. GitHub #Copilot proved invaluable in streamlining the programming process, suggesting optimizations, and aiding in logic creation and unit testing.
Here are the two simple steps to build such a web app:
1. Create the HTML file (index.html) and include the necessary Bootstrap components like a Button.
2. Assign an “id” to the HTML elements you wish to interact with, enabling access from the Java class. Get the id from Java using Elemental2 or Akasha and then you can do whatever you need to.
<button class="btn btn-lg btn-light fw-bold border-white bg-white"
id="helloButton" type="button">My Button
</button>
void addHelloButton() {
final HTMLButtonElement button = (HTMLButtonElement) DomGlobal.
document.getElementById("helloButton");
button.addEventListener("click", (Event event) -> {…