javafx

Recording Voice JAVAFX

徘徊边缘 提交于 2020-03-23 04:03:08
问题 I´m here again to request your great Help. I´m Trying to record voice from the microphone using a code from Internet. this is the configuration to the audio format: public class microfono { File wavFile = new File("C:\\NXB\\Kamui\\img\\audio.wav"); AudioFileFormat.Type fileType = AudioFileFormat.Type.WAVE; TargetDataLine line; AudioFormat getAudioFormat() { float sampleRate = 16000; int sampleSizeInBits = 8; int channels = 2; boolean signed = true; boolean bigEndian = true; AudioFormat format

Recording Voice JAVAFX

自古美人都是妖i 提交于 2020-03-23 04:02:13
问题 I´m here again to request your great Help. I´m Trying to record voice from the microphone using a code from Internet. this is the configuration to the audio format: public class microfono { File wavFile = new File("C:\\NXB\\Kamui\\img\\audio.wav"); AudioFileFormat.Type fileType = AudioFileFormat.Type.WAVE; TargetDataLine line; AudioFormat getAudioFormat() { float sampleRate = 16000; int sampleSizeInBits = 8; int channels = 2; boolean signed = true; boolean bigEndian = true; AudioFormat format

Recording Voice JAVAFX

a 夏天 提交于 2020-03-23 04:00:38
问题 I´m here again to request your great Help. I´m Trying to record voice from the microphone using a code from Internet. this is the configuration to the audio format: public class microfono { File wavFile = new File("C:\\NXB\\Kamui\\img\\audio.wav"); AudioFileFormat.Type fileType = AudioFileFormat.Type.WAVE; TargetDataLine line; AudioFormat getAudioFormat() { float sampleRate = 16000; int sampleSizeInBits = 8; int channels = 2; boolean signed = true; boolean bigEndian = true; AudioFormat format

JavaFX generate blank single color Image

烂漫一生 提交于 2020-03-21 06:53:49
问题 I would like to generate an image with just one color on it, to use for creating maps for PhongMaterials. Something like Image generateImage(int width, int height, double red, double green, double blue, double opacity); What do I need to do to make this? While I'd prefer to make this purely procedurally, if there's a way to do this by giving it a blank white image like https://dummyimage.com/600x400/ffffff/fff.png and changing its color, I would be okay with that too. I thought about just

How to keep “empty” selection on my combobox list in JavaFx?

感情迁移 提交于 2020-03-21 05:49:23
问题 In my application I hava combobox which is holding some values from databse ( some real time updated list ). This ComboBox list is updated every 1 minute. List dosen't have null values. When I'm setting this list to ComboBox.. ComboBox box = new ComboBox(items); .. there is one extra "empty" row, which is perfectly fine because non value is selected. Right after I'm selecting some value my "empty" value disappears from the list. My main question is How to keep this value on the list? Why this

How to keep “empty” selection on my combobox list in JavaFx?

断了今生、忘了曾经 提交于 2020-03-21 05:48:07
问题 In my application I hava combobox which is holding some values from databse ( some real time updated list ). This ComboBox list is updated every 1 minute. List dosen't have null values. When I'm setting this list to ComboBox.. ComboBox box = new ComboBox(items); .. there is one extra "empty" row, which is perfectly fine because non value is selected. Right after I'm selecting some value my "empty" value disappears from the list. My main question is How to keep this value on the list? Why this

Changing background colour in TableCell removes selection colour, makes it hard to read

不想你离开。 提交于 2020-03-19 06:45:10
问题 I made this change: Change TableColumn background in TableView, whilst retaining alternating row colour? It looks good unselected: : However when you select a cell: It looks like this, but I'd like it to act normally when selected/focused. I'm pretty sure I need to use a style class, however, I don't know what the attributes you need to retain every other feature of a TableCell just with a different colour background. Also, do I apply the style class at the Cell level or on the column level?

Select multiple dates with DatePicker

柔情痞子 提交于 2020-03-19 05:56:19
问题 I am trying to create a DatePicker that selects multiple dates. I am able to select multiple dates but I would like to keep the DatePicker open while I select them. Problem is, the DatePicker will close every time I select a date. I don't want to use a private API. I was thinking of adding this: datePicker.setOnHiding(event -> { event.consume(); }); But it doesn't work. Here is my code: public static DatePicker getDatePicker() { ObservableList<LocalDate> selectedDates = FXCollections

JavaFX create alert and get result

主宰稳场 提交于 2020-03-16 07:42:32
问题 For my CS class they require us to use JavaFX alerts. I can make an alert appear, but how do I get what button was clicked? What would be the best way to go about getting this data? Also if possible, I'd like to make it have a drop down panel and when the user selects and option the alert closes and prints what the user selected. Here's some example code that I have. When I click one of the buttons, it just closes the dialog. Alert a = new Alert(AlertType.NONE, "Promote pawn to:", new

JavaFX New Scene on Button Click

与世无争的帅哥 提交于 2020-03-09 20:00:08
问题 The title may be a bit vague, so allow me to define it a little better. I have a working piece of code (down below): a simple main menu for a game I am working on. Everything works well, except for the Start button. What I want to be able to do is click the Start button, and have a new scene appear on the same stage (window). I do not want to see a new window open. I have talked with someone more experienced in Java, and they told me to create separate classes for the MenuFX and the GameFX.