Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Prevent ICustomWidgetChartObject from disappearing
 Post subject: Prevent ICustomWidgetChartObject from disappearing Post rating: 0   New post Posted: Thu 03 Mar, 2022, 22:14 

User rating: 3
Joined: Fri 15 Nov, 2019, 12:54
Posts: 16
Location: Poland,
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.


 
 Post subject: Re: Prevent ICustomWidgetChartObject from disappearing Post rating: 0   New post Posted: Fri 11 Mar, 2022, 13:16 

User rating: 3
Joined: Fri 15 Nov, 2019, 12:54
Posts: 16
Location: Poland,
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);


 

Jump to:  

  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com