Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(demo): fix invalid input parsing error on text field #41

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,16 @@ public SimpletimerDemo() {
timer.getStyle().set("font-size", "40px");
timer.setStartTime(60);

Span timerTitle = new Span("Simple Count Up Timer");
final Span timerTitle = new Span("Simple Count Up Timer");

final TextField startTime =
new TextField("Start Time", e -> {
time = new BigDecimal(e.getValue());
update();
try {
time = new BigDecimal(e.getValue());
update();
} catch (final Exception ex) {
Notification.show("Please enter a number");
}
});
final Checkbox countUp = new Checkbox("Count Up", false);
countUp.addValueChangeListener(
Expand Down Expand Up @@ -111,7 +115,7 @@ public SimpletimerDemo() {
final HorizontalLayout topLayout = new HorizontalLayout(timerTitle, timer);
topLayout.setAlignItems(Alignment.CENTER);

HorizontalLayout options =
final HorizontalLayout options =
new HorizontalLayout(countUp, fractions, minutes, hours, visible, doubleDigitHours);
options.setAlignItems(Alignment.CENTER);
options.getStyle().set("flex-wrap", "wrap");
Expand Down
Loading