removed SwingUtilities.getWindowAncestor() from ItemPicker.

This commit is contained in:
hneemann 2018-01-22 18:33:15 +01:00
parent 86e751c7cd
commit e7a0b19ae7
2 changed files with 4 additions and 4 deletions

View File

@ -1294,7 +1294,7 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe
if (list.size() == 1)
vp = list.get(0);
else if (list.size() > 1) {
ItemPicker<VisualElement> picker = new ItemPicker<>(CircuitComponent.this, list);
ItemPicker<VisualElement> picker = new ItemPicker<>(parent, list);
vp = picker.select();
}
return vp;

View File

@ -28,7 +28,7 @@ public class ItemPicker<T> extends JDialog {
* @param parent the parent frame
* @param items the list of items
*/
public ItemPicker(Component parent, final java.util.List<T> items) {
public ItemPicker(Window parent, final java.util.List<T> items) {
this(parent, Lang.get("win_itempicker_title"), items);
}
@ -39,8 +39,8 @@ public class ItemPicker<T> extends JDialog {
* @param title title of the dialog
* @param items the list of items
*/
public ItemPicker(Component parent, final String title, final java.util.List<T> items) {
super(SwingUtilities.getWindowAncestor(parent), title, ModalityType.APPLICATION_MODAL);
public ItemPicker(Window parent, final String title, final java.util.List<T> items) {
super(parent, title, ModalityType.APPLICATION_MODAL);
this.items = items;
setDefaultCloseOperation(DISPOSE_ON_CLOSE);