fix some dialog weirdness
instantiate all JDialog instances with proper parent component set. this seems to make the ModalityType.APPLICATION_MODAL behave a bit better on newer JDK versions.
This commit is contained in:
parent
bbf7f5caa9
commit
5b5c866a69
|
@ -44,6 +44,7 @@ public class RecordDialog extends LlanfairDialog
|
|||
|
||||
public RecordDialog(EditRun editRun, Llanfair master)
|
||||
{
|
||||
super(editRun);
|
||||
this.master = master;
|
||||
this.editRun = editRun;
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ implements ActionListener, ListSelectionListener {
|
|||
* @param run - la course a éditer.
|
||||
*/
|
||||
public EditRun(Run run, Llanfair master) {
|
||||
super();
|
||||
super(master);
|
||||
if (run == null) {
|
||||
throw new NullPointerException("EditDialog.EditDialog(): null run");
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ public class EditSettings extends LlanfairDialog
|
|||
* Construction d’une boîte de dialogue d’édition de paramètres.
|
||||
*/
|
||||
public EditSettings(Llanfair master) {
|
||||
super(master);
|
||||
this.master = master;
|
||||
|
||||
settingsTabs = new ArrayList<SettingsTab>();
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.fenix.llanfair.dialog;
|
|||
import org.fenix.llanfair.Llanfair;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
|
@ -16,6 +17,18 @@ public class LlanfairDialog extends JDialog {
|
|||
|
||||
// ATTRIBUTS
|
||||
|
||||
public LlanfairDialog() {
|
||||
super();
|
||||
}
|
||||
|
||||
public LlanfairDialog(Frame owner) {
|
||||
super(owner);
|
||||
}
|
||||
|
||||
public LlanfairDialog(JDialog owner) {
|
||||
super(owner);
|
||||
}
|
||||
|
||||
public void display(boolean lockNativeInputs, final Llanfair llanfair) {
|
||||
if (lockNativeInputs) {
|
||||
llanfair.setIgnoreNativeInputs(true);
|
||||
|
@ -27,6 +40,7 @@ public class LlanfairDialog extends JDialog {
|
|||
}
|
||||
setAlwaysOnTop(true);
|
||||
setModalityType(ModalityType.APPLICATION_MODAL);
|
||||
setAutoRequestFocus(true);
|
||||
pack();
|
||||
setLocationRelativeTo(getOwner());
|
||||
setVisible(true);
|
||||
|
|
Reference in a new issue