Topic: java的一个bug 如何处理? (dialog 跑到主窗口后面, 不能操作)

  Print this page

1.java的一个bug 如何处理? (dialog 跑到主窗口后面, 不能操作) Copy to clipboard
Posted by: terry39
Posted on: 2003-05-10 11:29

主窗口 弹出一个 dialog
主窗口不接受 操作 动作

点其他窗口 然后 点任务栏上的程序 按钮 以便切换到 那个JAVA程序
结果 dialog 跑到主窗口 后面去了 ...

由于 dialog 没有关闭 所以 主窗口不接受操作 但有不能操作到dialog ...
... 于是 ... 只能 ctrl+alt+delete

(我在 windows 2000 p 里发现这个问题 怎么办? ...)

2.Re:java的一个bug 如何处理? ... [Re: terry39] Copy to clipboard
Posted by: yakuu
Posted on: 2003-05-10 11:50

your dialog need a parent window.
please use a frame or dialog as parent in your dialog constructor.

or setParent(Frame or Dialog);

3.Re:java的一个bug 如何处理? ... [Re: terry39] Copy to clipboard
Posted by: terry39
Posted on: 2003-05-10 12:05

我的dialog是 extends JDialog的 ...没有setParent的方法啊 ..?~??

4.Re:java的一个bug 如何处理? ... [Re: terry39] Copy to clipboard
Posted by: 烂泥
Posted on: 2003-05-10 13:31

晕倒,这个哪里是Bug???

5.Re:java的一个bug 如何处理? ... [Re: terry39] Copy to clipboard
Posted by: mochow
Posted on: 2003-05-10 15:23

用构造方法:
JDialog(Frame owner, String title, boolean modal)

多看看javadoc吧

6.Re:java的一个bug 如何处理? ... [Re: terry39] Copy to clipboard
Posted by: 铁针
Posted on: 2003-05-11 23:17

呵呵,挺有意思的小朋友。认为BUG的话倒不如去SUN看看BUG报告再来说是否是BUG。

7.Re:java的一个bug 如何处理? ... [Re: terry39] Copy to clipboard
Posted by: floater
Posted on: 2003-05-12 01:46

It's ok, everyone is ignorant on certain things.

Check the Java document for more info.

8.Re:java的一个bug 如何处理? ... [Re: terry39] Copy to clipboard
Posted by: terry39
Posted on: 2003-05-12 17:59

Smile ...

我已经处理好问题了 ...

JDialog好象没有自动 定位在owner的中间的方法?

9.Re:java的一个bug 如何处理? ... [Re: terry39] Copy to clipboard
Posted by: Jove
Posted on: 2003-05-12 19:24

terry39 wrote:
Smile ...

我已经处理好问题了 ...

JDialog好象没有自动 定位在owner的中间的方法?


就像定位在屏幕中央一样,需要你自己写.
当然考虑代码重用, 以后就不用再写了
算法很简单,
dlg.x=owner.x+(owner.width-dlg.width)/2
dlg.y=owner.y+(owner.height-dlg.height)/2


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923