Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have a bulleted list with an event handler?

I'm using seesaw to program an interface in Swing.

I want to display a bulleted list of items. When an item is clicked I want an event handler to be called.

I have managed to get event handlers working for components/widgets, and I can display a bulleted list easily by inserting HTML into a Label. I figure that if nothing else is possible I may need to capture mouse click events for the parent and work out offsets.

What's the best way to have a clickable bulleted list with event handlers?

like image 994
AnnanFay Avatar asked Nov 26 '25 19:11

AnnanFay


1 Answers

I think the easiest way would be to stick to widgets as much as possible. Working out offsets may become very difficult considering different font sizes and widget insets depending on platform. If you want to have a bullet list, why not simply put a bullet image in front of every label. This way you could easily listen for events on every individual label. Also, you won't constrain yourself to HTML which seesaw has no support for yet.

like image 76
MHOOO Avatar answered Nov 29 '25 22:11

MHOOO



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!