栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

DragTabFrame关闭不一致

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

DragTabFrame关闭不一致

停用计时器后,将最后一个选项卡拖到新的(不存在)框架中时发现了不一致之处。那是因为其他地方放置的不好,这使得负责检查和关闭原始frame的代码无法运行。我已经对它进行了这样的修改,并且到目前为止,它没有计时器:

    @Override    public void mouseReleased(MouseEvent e) {        JComponent c = (JComponent) e.getSource();        if (c.getTopLevelAncestor().getBounds().contains(e.getLocationOnScreen())) { // do nothing, the drop point is the same frame        } else { DragTabframe dtf = getTargetframe(e.getLocationOnScreen()); if (dtf == null) {     dtf = new DragTabframe();     dtf.init();     dtf.setLocation(e.getLocationOnScreen()); }// else { DragTabframe fromframe = dragTabManager.getCurrentframe(); fromframe.removeTabComponent(c); JTabbedPane tp = fromframe.getTabbedPane(); if (tp.getTabCount() == 0) {     fromframe.setVisible(false);     fromframe.dispose(); }  //} dtf.addTabComponent(dragTabManager.getCurrentTitle(), c); dtf.pack(); dtf.setVisible(true);        }    }

[…]

public DragTabManager() {        //timer = new Timer(200,actionListener);    //timer.start();}

我不认为应该有其他问题,尽管我不知道您提到的关闭JVM问题。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/509702.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号