JDK-4470141 : RedHat 7.1: KDE-only: Modal dialogs always placed at the top-left corner.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: x86
  • Submitted: 2001-06-14
  • Updated: 2001-06-25
  • Resolved: 2001-06-22
Related Reports
Duplicate :  
Description
Modal dialogs when invoked, appear always at the top-left corner of the screen irrespective of whether they have a owner or the owner is null. This happens only in KDE. In other OSs and GNOME, the dialog box appears on top of the owner if they have one else appear at the center of the screen (I think this is the right behaviour).

Tried in both b67 & b68.

Code to reproduce:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class testModal extends JFrame implements ActionListener {
  JPanel panel;
  JButton button1, button2, button3;

  public testModal() {
    setSize(600, 100);

    panel = new JPanel(new GridLayout(1,3));

    button1 = new JButton("No Parent");
    button1.addActionListener(this);
    button2 = new JButton("Parent=Panel");
    button2.addActionListener(this);
    button3 = new JButton("Parent=null");
    button3.addActionListener(this);
    panel.add(button1);
    panel.add(button2);
    panel.add(button3);

    getContentPane().add(panel);
  }

  public void actionPerformed(ActionEvent ae) {
    String btnAction = ae.getActionCommand();

    if (btnAction.equals("No Parent")) {
      JOptionPane.showInputDialog("choose one", "Input");
    }
    else
    if (btnAction.equals("Parent=Panel")) {
      JOptionPane.showInputDialog(panel, "choose one", "Input");
    }
    else
    if (btnAction.equals("Parent=null")) {
      JOptionPane.showInputDialog(null, "choose one", "Input");
    }
  }

  public static void main(String args[]) {
    testModal t = new testModal();
    t.setVisible(true);
  }
}  

Comments
EVALUATION Probably the same issue as 4102292? eric.hawkes@eng 2001-06-14 This is the same problem as 4102292 richard.ray@eng 2001-06-22
14-06-2001