Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4470141
Votes 0
Synopsis RedHat 7.1: KDE-only: Modal dialogs always placed at the top-left corner.
Category java:classes_awt
Reported Against merlin-beta2
Release Fixed
State 11-Closed, duplicate of 4102292, bug
Priority: 3-Medium
Related Bugs 4102292
Submit Date 14-JUN-2001
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);
  }
}  
Work Around
N/A
Evaluation
Probably the same issue as 4102292?  
  xxxxx@xxxxx   2001-06-14

This is the same problem as 4102292
  xxxxx@xxxxx   2001-06-22
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang