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)
|
public RecordDialog(EditRun editRun, Llanfair master)
|
||||||
{
|
{
|
||||||
|
super(editRun);
|
||||||
this.master = master;
|
this.master = master;
|
||||||
this.editRun = editRun;
|
this.editRun = editRun;
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ implements ActionListener, ListSelectionListener {
|
||||||
* @param run - la course a éditer.
|
* @param run - la course a éditer.
|
||||||
*/
|
*/
|
||||||
public EditRun(Run run, Llanfair master) {
|
public EditRun(Run run, Llanfair master) {
|
||||||
super();
|
super(master);
|
||||||
if (run == null) {
|
if (run == null) {
|
||||||
throw new NullPointerException("EditDialog.EditDialog(): null run");
|
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.
|
* Construction d’une boîte de dialogue d’édition de paramètres.
|
||||||
*/
|
*/
|
||||||
public EditSettings(Llanfair master) {
|
public EditSettings(Llanfair master) {
|
||||||
|
super(master);
|
||||||
this.master = master;
|
this.master = master;
|
||||||
|
|
||||||
settingsTabs = new ArrayList<SettingsTab>();
|
settingsTabs = new ArrayList<SettingsTab>();
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.fenix.llanfair.dialog;
|
||||||
import org.fenix.llanfair.Llanfair;
|
import org.fenix.llanfair.Llanfair;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
|
|
||||||
|
@ -16,6 +17,18 @@ public class LlanfairDialog extends JDialog {
|
||||||
|
|
||||||
// ATTRIBUTS
|
// ATTRIBUTS
|
||||||
|
|
||||||
|
public LlanfairDialog() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LlanfairDialog(Frame owner) {
|
||||||
|
super(owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LlanfairDialog(JDialog owner) {
|
||||||
|
super(owner);
|
||||||
|
}
|
||||||
|
|
||||||
public void display(boolean lockNativeInputs, final Llanfair llanfair) {
|
public void display(boolean lockNativeInputs, final Llanfair llanfair) {
|
||||||
if (lockNativeInputs) {
|
if (lockNativeInputs) {
|
||||||
llanfair.setIgnoreNativeInputs(true);
|
llanfair.setIgnoreNativeInputs(true);
|
||||||
|
@ -27,6 +40,7 @@ public class LlanfairDialog extends JDialog {
|
||||||
}
|
}
|
||||||
setAlwaysOnTop(true);
|
setAlwaysOnTop(true);
|
||||||
setModalityType(ModalityType.APPLICATION_MODAL);
|
setModalityType(ModalityType.APPLICATION_MODAL);
|
||||||
|
setAutoRequestFocus(true);
|
||||||
pack();
|
pack();
|
||||||
setLocationRelativeTo(getOwner());
|
setLocationRelativeTo(getOwner());
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
|
Reference in a new issue