Dukascopy Support Board http://www.dukascopy.com/swiss/english/forex/jforex/forum/ |
|
Prevent ICustomWidgetChartObject from disappearing http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=57799 |
Page 1 of 1 |
Author: | pminc74 [ Thu 03 Mar, 2022, 22:14 ] |
Post subject: | Prevent ICustomWidgetChartObject from disappearing |
Hi, My chart widget object (of type ICustomWidgetChartObject), created on chart in my plugin code, disappears everytime, when any other object existing on chart (like line, rectangle) is selected by clicking on it. Is it possible to prevent that behaviour? I'd like to see the widget even if some object on chart is selected. Thanks in advance. |
Author: | pminc74 [ Fri 11 Mar, 2022, 13:16 ] |
Post subject: | Re: Prevent ICustomWidgetChartObject from disappearing |
My workaround for above is as follows: // ICustomWidgetChartObject widget; // declare component listener private ComponentListener widgetComponentListener = new ComponentAdapter() { @Override public void componentHidden(ComponentEvent e) { e.getComponent().setVisible(true); // show again } // add the listener do widget's container JPanel panel = widget.getContentPanel(); Container container = panel.getParent(); container.addComponentListener(this.widgetComponentListener); |
Page 1 of 1 |