javafx

Determine if an event was consumed in JavaFX

断了今生、忘了曾经 提交于 2021-01-27 06:37:43
问题 I'm trying to do some off-piste stuff with event handling in JavaFX. I need to be able to determine if an event was consumed after I manually fire it. In the following example a synthetic mouse event is correctly received, however calling consume() does not update the event. I've debugged this and found JavaFX actually creates a new event instance so the original is unchanged public class EventManipulation extends Application { public static void main(String[] args) { launch(args); }

Determine if an event was consumed in JavaFX

*爱你&永不变心* 提交于 2021-01-27 06:35:12
问题 I'm trying to do some off-piste stuff with event handling in JavaFX. I need to be able to determine if an event was consumed after I manually fire it. In the following example a synthetic mouse event is correctly received, however calling consume() does not update the event. I've debugged this and found JavaFX actually creates a new event instance so the original is unchanged public class EventManipulation extends Application { public static void main(String[] args) { launch(args); }

Howto embed font variants in JavaFX

自闭症网瘾萝莉.ら 提交于 2021-01-27 06:20:08
问题 I need to embed local .ttf files on a JavaFX project with some variants (bold, italic and so on) but the css parser seems to not support font properties in @font-face declaration: @font-face { font-family: 'Open Sans', sans-serif; src: url('fonts/OpenSans-Regular.ttf'); } @font-face { font-family: 'Open Sans', sans-serif; src: url('fonts/OpenSans-Bold.ttf'); font-weight: bold; } @font-face { font-family: 'Open Sans', sans-serif; src: url('fonts/OpenSans-ExtraBoldItalic.ttf'); font-style:

JavaFX Image Loading in Background and Threads

安稳与你 提交于 2021-01-27 06:11:32
问题 I thought this would be a simple question but I am having trouble finding an answer. I have a single ImageView object associated with a JavaFX Scene object and I want to load large images in from disk and display them in sequence one after another using the ImageView. I have been trying to find a good way to repeatedly check the Image object and when it is done loading in the background set it to the ImageView and then start loading a new Image object. The code I have come up with (below)

JavaFX Image Loading in Background and Threads

感情迁移 提交于 2021-01-27 06:11:05
问题 I thought this would be a simple question but I am having trouble finding an answer. I have a single ImageView object associated with a JavaFX Scene object and I want to load large images in from disk and display them in sequence one after another using the ImageView. I have been trying to find a good way to repeatedly check the Image object and when it is done loading in the background set it to the ImageView and then start loading a new Image object. The code I have come up with (below)

How to disable mnemonic for JavaFX MenuBar?

拈花ヽ惹草 提交于 2021-01-27 05:29:23
问题 In my stage I have inserted a menubar at the top like usual for programs. I want to give the ALT key (together with arrow keys) some logic in another context within the stage. But everytime I press ALT and arrows I unintentionally navigate through the menus of the menubar, too. I want to avoid that or better completely disable this mnemonic behavior. Setting the mnemonicParsing properties of all menus to false failed. I also tried this approach without success: menubar.addEventFilter(KeyEvent

How to disable mnemonic for JavaFX MenuBar?

寵の児 提交于 2021-01-27 05:27:10
问题 In my stage I have inserted a menubar at the top like usual for programs. I want to give the ALT key (together with arrow keys) some logic in another context within the stage. But everytime I press ALT and arrows I unintentionally navigate through the menus of the menubar, too. I want to avoid that or better completely disable this mnemonic behavior. Setting the mnemonicParsing properties of all menus to false failed. I also tried this approach without success: menubar.addEventFilter(KeyEvent

How to disable mnemonic for JavaFX MenuBar?

两盒软妹~` 提交于 2021-01-27 05:27:08
问题 In my stage I have inserted a menubar at the top like usual for programs. I want to give the ALT key (together with arrow keys) some logic in another context within the stage. But everytime I press ALT and arrows I unintentionally navigate through the menus of the menubar, too. I want to avoid that or better completely disable this mnemonic behavior. Setting the mnemonicParsing properties of all menus to false failed. I also tried this approach without success: menubar.addEventFilter(KeyEvent

How to disable mnemonic for JavaFX MenuBar?

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-27 05:26:35
问题 In my stage I have inserted a menubar at the top like usual for programs. I want to give the ALT key (together with arrow keys) some logic in another context within the stage. But everytime I press ALT and arrows I unintentionally navigate through the menus of the menubar, too. I want to avoid that or better completely disable this mnemonic behavior. Setting the mnemonicParsing properties of all menus to false failed. I also tried this approach without success: menubar.addEventFilter(KeyEvent

How to disable mnemonic for JavaFX MenuBar?

删除回忆录丶 提交于 2021-01-27 05:25:41
问题 In my stage I have inserted a menubar at the top like usual for programs. I want to give the ALT key (together with arrow keys) some logic in another context within the stage. But everytime I press ALT and arrows I unintentionally navigate through the menus of the menubar, too. I want to avoid that or better completely disable this mnemonic behavior. Setting the mnemonicParsing properties of all menus to false failed. I also tried this approach without success: menubar.addEventFilter(KeyEvent