I'm trying to add filtering content in ListView by selected date from DatePicker. Every position(movie) has it's emission date saved, so when you choose date that you're interested in, it will show just matching titles. I was trying to use this solution:
I want to synchronize a List<String> with the selected items of a ListView. In the real project, I want to synchronize the selected items of a TreeView and the selected images of a galery (custom control).
In most cases, the program works as expected but sometimes there are some issues.
- For example, when I launch the application and select all the items with Ctrl-A, the event { [One, Two, Three] added at 0, } is fired so the list of strings contains incorrectly 4 elements [One, Two, Three, One].
- Another example, when selecting all the items (with Shift+End), two events are fired { [One] removed at 0, } and { [One, Two, Three] added at 0, }, that's correct. But when I remove the last element with Shift-Up, 3 events are fired { [Two] removed at 1, }, { [Three] removed at 2, } and { [Two] added at 1, } and an exception is thrown:
java.lang.IndexOutOfBoundsException: toIndex = 3 at java.util.ArrayList.subListRangeCheck(ArrayList.java:1004) at java.util.ArrayList.subList(ArrayList.java:996) at com.sun.javafx.binding.ContentBinding$ListContentBinding.onChanged(ContentBinding.java:111)
I have a ListView with ListCells that are complicated things containing other nodes. I want to turn of ListView selection behavior (so not allow selections) without turning of events to the ListCell nodes in the ListView.
I can't figure out how using binding on selectionModelProperty in a ListView that is using MULTIPLE selection model. I want bind my bean in which I've a list of item A and the selection of that items into the List.
I have a selection listener attached to a TreeView as shown below
treeView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<TreeItem<Pair<VideoSourceType, String>>>() { @Override public void changed(ObservableValue<? extends TreeItem<Pair<VideoSourceType, String>>> observable, final TreeItem<Pair<VideoSourceType, String>> oldValue, final TreeItem<Pair<VideoSourceType, String>> newValue) { // do something treeView.getSelectionModel().clearSelection(); } };
What I want to do is to "do something" and then clear the selection so that it can be selected again. However, I cannot re-select the same item from the TreeView until I first select a different item.
I have an app that was working with JavaFX 2 on JDK 7 but seems to no longer work in JavaFX 8 on JDK 8. The story is that I have a ListView where I have provided my own CellFactory. Within the class that extends ListCell, in the updateItem() method, I create an HBox that contains some text and a new button.
I register an onAction() callback for the button. The end result should be a list with entries which contain buttons and when a button is clicked, the onAction() callback is invoked. However, when I run it and click the button, the callback is NOT being fired. This exact code was working on JavaFX 2 and JDK 7.
I only want the context menu to be showen if the user is clicking on an actual listview item, not if they click anywhere else in the listview. I know this is possible and I found answers to similar problems, but in the end they didn't provide enough infomation for me to solve my issue. I found this example on how to do it with a list view containing String objects, but what if my list view contains another object, in my case a wrapper class? I have a wrapper class to keep track of the key, but I only display the value variable in the listview, through calling the toString method. So the cells still contain a wrapper.
class Wrapper(int key, String value) { .. } public String getValue() { return value; } public SimpleStringProperty getValueAsProperty() { return new SimpleStringProperty(value); } public String toString() { return value; }
[Code]....
But line 05 gives me a NullPointerException, why? I do this after I've set the items of the list view by doing listView.setItems(..).
If I "embed" a ProgressIndicator inside a ListView it has an ugly border and a white background. It looks like there's a TextField below the ProgressIndicator.
Why does it behave like that and how to solve it so that the progress indicator is transparent.
public class Person { private SimpleStringProperty name; public SimpleStringProperty nameProperty(){ if(this.name==null){ this.name=new SimpleStringProperty();
[Code] .....
I have this:
lista = FXCollections.<Person>observableArrayList(); lista.addAll(new Person("uno"),new Person("due"),new Person("tre")); myListView.setItems(lista);
The problem is if I add /remove an item all is fine, the listView refreshes correctly:
Person p = new Person(tfld_textAdd.getText()); lista.add(0, p);
But if I change a value on an item into the observable list it doesn't:
lista.get(0).setName("new value");
I also have a table linked in the same way and the table workd correctly after I updated my Java version...
select 3 elements from the list: you'll see the log of the ChangeListener that tell you every time all items selected remove 1 element from previous selection: you will not receive the notification!!! remove the other two elements: only when the selection is empty you will see a new notification from changeListener...
I try to bind the text-property of a selected cell of a TreeView to a label. So if the user click on a cell in the treeview the label should show the cell text. Now I am quite confused about the options I got to do so. Should I use label.textProperty().bind( ... ??? ... ) The treeview.onMouseClicked()property? or something different?
I'm using a JFileChooser. I'm using a FileNameExtensionFilter which is fantastic, and will let me only show files that are of type .db or whatever. However, I don't want to show the user files that have a type of lock.db or *_trace.db for example, and I can't figure out a way to do that.
I am familiar with Java but new to JSP. I have a Java Servlet app where user actions are recorded in a SQL Server database amd I now need to quickly put together a JSP front end application to view user actions. I want two drop down boxes to filter the results that will be displayed in a list box. What I need is the first drop down list box to show unique user names that have logged in. I can interrogate the database with the following SQL;
"SELECT DISTINCT(USER_ID) FROM AUDIT_MESSAGE"
Then when a user is selected from the first drop down list box (perhaps some sort of on change event) a second drop down list box shows the logins times of the selected user. Again I can interrogate the database with the following SQL;
SELECT SESSION_ID, EventTIME FROM dbo.AUDIT_MESSAGE WHERE OPERATION = 'loginResponse' AND RESULTS = 'OK' AND USER_ID = 'firstdropdownlistselection'
Then finally when a login time is selected in the second drop down list box all events for the selected user while logged in with that login time are displayed in the list box.
I have a jtable. the fields are like Product_code,Product_name,Qty,Rate in my java program.. now i want to do is when i press a first letter in my jtable under Product_name like "P" it will display the reminding Product_name which will have the starting letter of "P" like pen, pencil, peper like this i want to populate in my jtable.
I have an requirement of splitting a Date-Time String i.e. 2013/07/26 07:05:36 As you observe the above string has Date and Time with space in between them.
Now I want just want split the string not by delimiter but by length i.e. after 10th place and then assign it to 2 variable i.e. Date <----2013/07/26 and Time <---07:05:36 separately.
1. Write an algorithm that asks the user for your birth date and the current date and displays how many days has passed since then (remember that April, June, September and November has 30 days, February has 29 on leap years, and the rest 31)
2. Write an algorithm that asks the user a number (save it as N) and displays the N term of the Fibonnacci series (take it as 1, 1, 2, 3, 5 ...)
Given a Date such as this sampleDate (120, 08, 02), does SimpleDateFormat transform this given sampleDate using (sampleDate.get(Calendar.DATE)) ?
Issue is that without the SimpleDateFormat the days are outputting correctly but starting with 1,2,3,4 etc and when I apply the SimpleDateFormat to the above Date I only get 01,01,01 etc...
I'm making a class in Android that takes a photo, list a photos in Listview, and then sends them all to server. I'm stuck on listing them. How to send them all to server.
How do i make the 'date' column show only the date and 'timeIn' and 'timeOut' column only show the time. In my database table my 'date' column is a date type and 'timeIn' and 'timeOut' column is time.
I'm currently writing a small program, where I need to save data into a Defaulttablemodel in a jTable.I have to save the name, a number and the email-adress.I added a button which opens a new JFrame and there I need to change the email and/or the name.My current solution is far from good: No matter which row I select, i can only update the "newest" row (last created). How can I visualize the values of the selected row (out.println// or whatever) so I can go further and overwrite these values.My Code when I click on Update:
int zeilenwahl = jTableStudenttab.getSelectedRow(); // System.out.println(jTableStudenttab.getSelectedRow()); if (zeilenwahl != -1) { this.setVisible(false); new Bearbeitung().setVisible(true); } else { JOptionPane.showMessageDialog(rootPane, "Zum Bearbeiten Zeile auswählen"); }