javafx

JavaFX unfilter FilteredList

陌路散爱 提交于 2019-12-25 09:39:29
问题 I have got a ObservableList and I linked it to multiple CheckMenuItem it's shown in a TableView and I can filter out one predicate. I did that by using .filter(Predicate p) and updated my TableView to it's return value. When I wanted to unfilter, I simply set it back on my ObservableList . But I can't wrap my head around on how to remove multiple filteres to my ObservableList . I can apply them if i just keep using .filter(Predicate p) with different predicates on the returned lists, but how

JavaFX unfilter FilteredList

二次信任 提交于 2019-12-25 09:39:03
问题 I have got a ObservableList and I linked it to multiple CheckMenuItem it's shown in a TableView and I can filter out one predicate. I did that by using .filter(Predicate p) and updated my TableView to it's return value. When I wanted to unfilter, I simply set it back on my ObservableList . But I can't wrap my head around on how to remove multiple filteres to my ObservableList . I can apply them if i just keep using .filter(Predicate p) with different predicates on the returned lists, but how

How to cange a the cursor type by clicking on a button in JavaFX?

你。 提交于 2019-12-25 09:34:02
问题 Maybe this questionis silly but i didn't get any idea about how to change the Cursor type in JavaFX Application but when i run the application and clicking on the button it does anything it should be set the Cursor_WAIT and then loading a page in the WebView and then return the Cursor_DEFAULT so this is the code i've traied: @FXML private void tabfirst (ActionEvent ee) throws IOException { // for tha Chooser frame text. String hh = text11.getText(); Socket socket = new Socket(); try { //do

Determine which JavaFX ListView item was clicked on without selecting it

百般思念 提交于 2019-12-25 09:31:06
问题 My JavaFX application has a ListView that contains items that need to be processed. I have two buttons that the user can click to process the next item in the list (i.e. a "forward" button), or to undo the processing of the last item in the list (i.e. a "back" button). I don't want them to arbitrarily select items in the list (they should only be able to move around using those two buttons). However, I would like them to be able to right click on items to get some contextual menu (e.g. like

Unable to Center a Grid Using JavaFX

烂漫一生 提交于 2019-12-25 09:17:28
问题 I'm using grid.setAlignment(Pos.CENTER); to center my grid within the JavaFX scene however it doesn't seem to work. The grid always displays in the top left of the scene no matter what position I give it. Can anyone see what I'm doing wrong? My entire code (minus imports) is as follows: *public class Main extends Application { @Override public void start(Stage stage) throws Exception { Scene scene = new Scene(new Group(), 450, 250); Button btn = new Button(); btn.setText("Run"); final

FXML: Bind to nested field

こ雲淡風輕ζ 提交于 2019-12-25 09:17:10
问题 I have a TableColumn coded as: <TableColumn text="Nom" prefWidth="${purchasesTable.width*0.65}"> <cellValueFactory> <PropertyValueFactory property="item.name" /> </cellValueFactory> </TableColumn> it's TableView 's items property is bound to a list of Purchase class: Purchase class: public class Purchase { private Item item; public Item getItem() { return item; } public void setItem(Item item) { this.item = item; } } My Item class is as follows: public class Item { private long id; private

JavaFX MediaPlayer playing background music loop with small intro music

落花浮王杯 提交于 2019-12-25 09:11:03
问题 I am trying to create a game using JavaFX. I had been trying to insert some background musics to the game. The musics are of compatible .mp3 files. I am currently using MediaPlayer to playback each Media . Each media file consist of the actual loop and a small (optional) intro music to the loop. How can I achieve smooth audio playback using JavaFX. Methods I have tried: Using the Media as one file; I try to alter the mediaPlayer.startTime , mediaPlayer.stopTime . It seems that the duration of

JavaFX Tableview make specific cells colored

只愿长相守 提交于 2019-12-25 09:01:07
问题 TableColumn tc = new TableColumn(); tc.getStyleClass.add(".style in css file") i set up the tablecolumn with css file. and i want to make each cell has different backgrounds. is there any way to do it? tableColumn row 1 bakcground color = green, row2 = red, row3 = blue....etc 回答1: You have to use setRowFactory for your TableView and change row style. A little example there: tableView.setRowFactory(new Callback<TableView<Data_type>, TableRow<Data_type>>(){ //There can define some colors. int

Advise method error in Spring AOP

别等时光非礼了梦想. 提交于 2019-12-25 08:57:38
问题 I'm trying to run an advise in a Spring AOP program but I keep getting this error: Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.sun.javafx.application.LauncherImpl

TableView Enhancements

雨燕双飞 提交于 2019-12-25 08:57:23
问题 The TableView still leaves a lot to be desired. Does anyone have a more complex example of a TableView that you would like to share? Here's what I'm missing: Insert and Delete row: Possible solutions: press TAB on the last cell and new row gets inserted automatically right mouse button -> context menu -> insert line (or delete line) a table footer with table navigation and insert/delete buttons (like MS Access) keyboard shortcut ... Insert and Delete should be either at the current row